Merge branch 'main' into production

This commit is contained in:
Mouse Reeve 2022-03-13 12:08:35 -07:00
commit 3ebdd432ec
5 changed files with 93 additions and 2 deletions

View file

@ -188,6 +188,7 @@ STATICFILES_FINDERS = [
]
SASS_PROCESSOR_INCLUDE_FILE_PATTERN = r"^.+\.[s]{0,1}(?:a|c)ss$"
SASS_PROCESSOR_ENABLED = True
SASS_PROCESSOR_INCLUDE_DIRS = [
os.path.join(BASE_DIR, ".css-config-sample"),

View file

@ -8,7 +8,7 @@
<head>
<title>{% block title %}BookWyrm{% endblock %} - {{ site.name }}</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="{% sass_src 'css/themes/bookwyrm-light.scss' %}" rel="stylesheet" type="text/css" />
<link href="{% sass_src site_theme %}" rel="stylesheet" type="text/css" />
<link rel="search" type="application/opensearchdescription+xml" href="{% url 'opensearch' %}" title="{% blocktrans with site_name=site.name %}{{ site_name }} search{% endblocktrans %}" />

View file

@ -29,7 +29,7 @@
{% trans "Copy the theme file into the <code>bookwyrm/static/css/themes</code> directory on your server from the command line." %}
</li>
<li>
{% trans "Run <code>./bw-dev compilescss</code>." %}
{% trans "Run <code>./bw-dev collectstatic</code>." %}
</li>
<li>
{% trans "Add the file name using the form below to make it available in the application interface." %}

1
bw-dev
View file

@ -178,6 +178,7 @@ case "$CMD" in
*)
set +x # No need to echo echo
echo "Unrecognised command. Try:"
echo " setup"
echo " up [container]"
echo " initdb"
echo " makemigrations [migration]"

89
complete_bwdev.fish Normal file
View file

@ -0,0 +1,89 @@
# bw-dev auto-completions for fish-shell.
# copy this to ~./.config/fish/completions/ with the name `bw-dev.fish`
# this will only work if renamed to `bw-dev.fish`.
set -l commands up \
service_ports_web \
initdb \
resetdb \
makemigrations \
migrate \
bash \
shell \
dbshell \
restart_celery \
pytest \
collectstatic \
makemessages \
compilemessages \
update_locales \
build \
clean \
black \
prettier \
stylelint \
formatters \
compilescss \
collectstatic_watch \
populate_streams \
populate_lists_streams \
populate_suggestions \
generate_thumbnails \
generate_preview_images \
copy_media_to_s3 \
set_cors_to_s3 \
setup \
admin_code \
runweb
function __bw_complete -a cmds cmd desc
complete -f -c bw-dev -n "not __fish_seen_subcommand_from $cmds" -a $cmd -d $desc
end
__bw_complete "$commands" "up" "bring one or all service(s) up"
__bw_complete "$commands" "service_ports_web" "run command on the web container with its portsenabled and mapped"
__bw_complete "$commands" "initdb" "initialize database"
__bw_complete "$commands" "resetdb" "!! WARNING !! reset database"
__bw_complete "$commands" "makemigrations" "create new migrations"
__bw_complete "$commands" "migrate" "perform all migrations"
__bw_complete "$commands" "bash" "open up bash within the web container"
__bw_complete "$commands" "shell" "open the Python shell within the web container"
__bw_complete "$commands" "dbshell" "open the database shell within the web container"
__bw_complete "$commands" "restart_celery" "restart the celery container"
__bw_complete "$commands" "pytest" "run unit tests"
__bw_complete "$commands" "collectstatic" "copy changed static files into the installation"
__bw_complete "$commands" "makemessages" "extract all localizable messages from the code"
__bw_complete "$commands" "compilemessages" "compile .po localization files to .mo"
__bw_complete "$commands" "update_locales" "run makemessages and compilemessages for the en_US and additional locales"
__bw_complete "$commands" "build" "build the containers"
__bw_complete "$commands" "clean" "bring the cluster down and remove all containers"
__bw_complete "$commands" "black" "run Python code formatting tool"
__bw_complete "$commands" "prettier" "run JavaScript code formatting tool"
__bw_complete "$commands" "stylelint" "run SCSS linting tool"
__bw_complete "$commands" "formatters" "run multiple formatter tools"
__bw_complete "$commands" "compilescss" "compile the SCSS layouts to CSS"
__bw_complete "$commands" "populate_streams" "populate the main streams"
__bw_complete "$commands" "populate_lists_streams" "populate streams for book lists"
__bw_complete "$commands" "populate_suggestions" "populate book suggestions"
__bw_complete "$commands" "generate_thumbnails" "generate book thumbnails"
__bw_complete "$commands" "generate_preview_images" "generate book preview images"
__bw_complete "$commands" "collectstatic_watch" "watch filesystem and copy changed static files"
__bw_complete "$commands" "copy_media_to_s3" "run the `s3 cp` command to copy media to a bucket on S3"
__bw_complete "$commands" "sync_media_to_s3" "run the `s3 sync` command to sync media with a bucket on S3"
__bw_complete "$commands" "set_cors_to_s3" "push a CORS configuration defined in .json to s3"
__bw_complete "$commands" "setup" "perform first-time setup"
__bw_complete "$commands" "admin_code" "get the admin code"
__bw_complete "$commands" "runweb" "run a command on the web container"
function __bw_complete_subcommand -a cmd
complete -f -c bw-dev -n "__fish_seen_subcommand_from $cmd" $argv[2..-1]
end
__bw_complete_subcommand "up" -a "(docker-compose config --service)"
__bw_complete_subcommand "pytest" -a "bookwyrm/tests/**.py"
__bw_complete_subcommand "populate_streams" -a "--stream=" -d "pick a single stream to populate"
__bw_complete_subcommand "populate_streams" -l stream -a "home local books"
__bw_complete_subcommand "generate_preview_images" -a "--all"\
-d "Generates images for ALL types: site, users and books. Can use a lot of computing power."
__bw_complete_subcommand "set_cors_to_s3" -a "**.json"