diff --git a/static/src/scss/_content.scss b/static/src/scss/_content.scss index 6e42195..d2038f4 100644 --- a/static/src/scss/_content.scss +++ b/static/src/scss/_content.scss @@ -41,14 +41,3 @@ section.content { max-width: calc(99% - ($column-gap * 2)); } } - -.blog-filter { - &, - .tag { - font-size: 1.25rem; - } - - .tag { - font-family: $family-code; - } -} diff --git a/website/blog/migrations/0014_blogposttaglistpage_blogposttagpage_and_more.py b/website/blog/migrations/0014_blogposttaglistpage_blogposttagpage_and_more.py new file mode 100644 index 0000000..f1d0a71 --- /dev/null +++ b/website/blog/migrations/0014_blogposttaglistpage_blogposttagpage_and_more.py @@ -0,0 +1,1953 @@ +# Generated by Django 4.0.5 on 2022-07-16 08:36 + +import django.db.models.deletion +import wagtail.blocks +import wagtail.embeds.blocks +import wagtail.fields +import wagtail.images.blocks +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("images", "0001_initial"), + ("wagtailcore", "0069_log_entry_jsonfield"), + ("unsplash", "0002_unsplashphoto_created_and_more"), + ("blog", "0013_alter_bloglistpage_body_alter_blogpostpage_body"), + ] + + operations = [ + migrations.CreateModel( + name="BlogPostTagListPage", + fields=[ + ( + "page_ptr", + models.OneToOneField( + auto_created=True, + on_delete=django.db.models.deletion.CASCADE, + parent_link=True, + primary_key=True, + serialize=False, + to="wagtailcore.page", + ), + ), + ("subtitle", models.CharField(blank=True, max_length=255)), + ( + "body", + wagtail.fields.StreamField( + [ + ("embed", wagtail.embeds.blocks.EmbedBlock()), + ( + "rich_text", + wagtail.blocks.RichTextBlock( + features=[ + "h2", + "h3", + "h4", + "h5", + "h6", + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + "code", + "strikethrough", + "snippet-link", + "snippet-embed", + ] + ), + ), + ( + "lorem", + wagtail.blocks.StructBlock( + [ + ( + "paragraphs", + wagtail.blocks.IntegerBlock(min_value=1), + ) + ] + ), + ), + ("html", wagtail.blocks.RawHTMLBlock()), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock(), + ), + ( + "caption", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + "code", + "strikethrough", + "snippet-link", + ] + ), + ), + ] + ), + ), + ( + "code", + wagtail.blocks.StructBlock( + [ + ( + "language", + wagtail.blocks.ChoiceBlock( + choices=[ + ("ABAP", "ABAP"), + ("ABNF", "ABNF"), + ("ADL", "ADL"), + ("AMDGPU", "AMDGPU"), + ( + "ANSYS parametric design language", + "ANSYS parametric design language", + ), + ("ANTLR", "ANTLR"), + ( + "ANTLR With ActionScript Target", + "ANTLR With ActionScript Target", + ), + ( + "ANTLR With C# Target", + "ANTLR With C# Target", + ), + ( + "ANTLR With CPP Target", + "ANTLR With CPP Target", + ), + ( + "ANTLR With Java Target", + "ANTLR With Java Target", + ), + ( + "ANTLR With ObjectiveC Target", + "ANTLR With ObjectiveC Target", + ), + ( + "ANTLR With Perl Target", + "ANTLR With Perl Target", + ), + ( + "ANTLR With Python Target", + "ANTLR With Python Target", + ), + ( + "ANTLR With Ruby Target", + "ANTLR With Ruby Target", + ), + ("APL", "APL"), + ("ASCII armored", "ASCII armored"), + ("ActionScript", "ActionScript"), + ( + "ActionScript 3", + "ActionScript 3", + ), + ("Ada", "Ada"), + ("Agda", "Agda"), + ("Aheui", "Aheui"), + ("Alloy", "Alloy"), + ("AmbientTalk", "AmbientTalk"), + ("Ampl", "Ampl"), + ("Angular2", "Angular2"), + ("ApacheConf", "ApacheConf"), + ("AppleScript", "AppleScript"), + ("Arduino", "Arduino"), + ("Arrow", "Arrow"), + ("AspectJ", "AspectJ"), + ("Asymptote", "Asymptote"), + ("Augeas", "Augeas"), + ("AutoIt", "AutoIt"), + ("Awk", "Awk"), + ("BARE", "BARE"), + ("BBC Basic", "BBC Basic"), + ("BBCode", "BBCode"), + ("BC", "BC"), + ("BNF", "BNF"), + ("BST", "BST"), + ("BUGS", "BUGS"), + ("Base Makefile", "Base Makefile"), + ("Bash", "Bash"), + ("Bash Session", "Bash Session"), + ("Batchfile", "Batchfile"), + ("Bdd", "Bdd"), + ("Befunge", "Befunge"), + ("Berry", "Berry"), + ("BibTeX", "BibTeX"), + ("BlitzBasic", "BlitzBasic"), + ("BlitzMax", "BlitzMax"), + ("Boa", "Boa"), + ("Boo", "Boo"), + ("Boogie", "Boogie"), + ("Brainfuck", "Brainfuck"), + ("C", "C"), + ("C#", "C#"), + ("C++", "C++"), + ("CAmkES", "CAmkES"), + ("CBM BASIC V2", "CBM BASIC V2"), + ("CDDL", "CDDL"), + ("CFEngine3", "CFEngine3"), + ("CMake", "CMake"), + ("COBOL", "COBOL"), + ("COBOLFree", "COBOLFree"), + ("CPSA", "CPSA"), + ("CSS", "CSS"), + ( + "CSS+Django/Jinja", + "CSS+Django/Jinja", + ), + ( + "CSS+Genshi Text", + "CSS+Genshi Text", + ), + ("CSS+Lasso", "CSS+Lasso"), + ("CSS+Mako", "CSS+Mako"), + ("CSS+Myghty", "CSS+Myghty"), + ("CSS+PHP", "CSS+PHP"), + ("CSS+Ruby", "CSS+Ruby"), + ("CSS+Smarty", "CSS+Smarty"), + ("CSS+UL4", "CSS+UL4"), + ( + "CSS+mozpreproc", + "CSS+mozpreproc", + ), + ("CUDA", "CUDA"), + ("Cap'n Proto", "Cap'n Proto"), + ("CapDL", "CapDL"), + ("Ceylon", "Ceylon"), + ("ChaiScript", "ChaiScript"), + ("Chapel", "Chapel"), + ("Charmci", "Charmci"), + ("Cheetah", "Cheetah"), + ("Cirru", "Cirru"), + ("Clay", "Clay"), + ("Clean", "Clean"), + ("Clojure", "Clojure"), + ("ClojureScript", "ClojureScript"), + ("CoffeeScript", "CoffeeScript"), + ( + "Coldfusion CFC", + "Coldfusion CFC", + ), + ( + "Coldfusion HTML", + "Coldfusion HTML", + ), + ("Common Lisp", "Common Lisp"), + ( + "Component Pascal", + "Component Pascal", + ), + ("Coq", "Coq"), + ("Crmsh", "Crmsh"), + ("Croc", "Croc"), + ("Cryptol", "Cryptol"), + ("Crystal", "Crystal"), + ( + "Csound Document", + "Csound Document", + ), + ( + "Csound Orchestra", + "Csound Orchestra", + ), + ("Csound Score", "Csound Score"), + ("Cypher", "Cypher"), + ("Cython", "Cython"), + ("D", "D"), + ("DASM16", "DASM16"), + ("DTD", "DTD"), + ("Darcs Patch", "Darcs Patch"), + ("Dart", "Dart"), + ( + "Debian Control file", + "Debian Control file", + ), + ( + "Debian Sourcelist", + "Debian Sourcelist", + ), + ("Delphi", "Delphi"), + ("Devicetree", "Devicetree"), + ("Diff", "Diff"), + ("Django/Jinja", "Django/Jinja"), + ("Docker", "Docker"), + ("Duel", "Duel"), + ("Dylan", "Dylan"), + ("Dylan session", "Dylan session"), + ("DylanLID", "DylanLID"), + ("E-mail", "E-mail"), + ("EBNF", "EBNF"), + ("ECL", "ECL"), + ("ERB", "ERB"), + ("Earl Grey", "Earl Grey"), + ("Easytrieve", "Easytrieve"), + ("Eiffel", "Eiffel"), + ("Elixir", "Elixir"), + ( + "Elixir iex session", + "Elixir iex session", + ), + ("Elm", "Elm"), + ("Elpi", "Elpi"), + ("EmacsLisp", "EmacsLisp"), + ( + "Embedded Ragel", + "Embedded Ragel", + ), + ("Erlang", "Erlang"), + ( + "Erlang erl session", + "Erlang erl session", + ), + ("Evoque", "Evoque"), + ("Ezhil", "Ezhil"), + ("F#", "F#"), + ("FStar", "FStar"), + ("Factor", "Factor"), + ("Fancy", "Fancy"), + ("Fantom", "Fantom"), + ("Felix", "Felix"), + ("Fennel", "Fennel"), + ("Fish", "Fish"), + ("Flatline", "Flatline"), + ("FloScript", "FloScript"), + ("Forth", "Forth"), + ("Fortran", "Fortran"), + ("FortranFixed", "FortranFixed"), + ("FoxPro", "FoxPro"), + ("Freefem", "Freefem"), + ("Futhark", "Futhark"), + ("GAP", "GAP"), + ("GAS", "GAS"), + ("GDScript", "GDScript"), + ("GLSL", "GLSL"), + ("GSQL", "GSQL"), + ("Genshi", "Genshi"), + ("Genshi Text", "Genshi Text"), + ( + "Gettext Catalog", + "Gettext Catalog", + ), + ("Gherkin", "Gherkin"), + ("Gnuplot", "Gnuplot"), + ("Go", "Go"), + ("Golo", "Golo"), + ("GoodData-CL", "GoodData-CL"), + ("Gosu", "Gosu"), + ("Gosu Template", "Gosu Template"), + ("Graphviz", "Graphviz"), + ("Groff", "Groff"), + ("Groovy", "Groovy"), + ("HLSL", "HLSL"), + ("HSAIL", "HSAIL"), + ("HTML", "HTML"), + ( + "HTML + Angular2", + "HTML + Angular2", + ), + ("HTML+Cheetah", "HTML+Cheetah"), + ( + "HTML+Django/Jinja", + "HTML+Django/Jinja", + ), + ("HTML+Evoque", "HTML+Evoque"), + ("HTML+Genshi", "HTML+Genshi"), + ( + "HTML+Handlebars", + "HTML+Handlebars", + ), + ("HTML+Lasso", "HTML+Lasso"), + ("HTML+Mako", "HTML+Mako"), + ("HTML+Myghty", "HTML+Myghty"), + ("HTML+PHP", "HTML+PHP"), + ("HTML+Smarty", "HTML+Smarty"), + ("HTML+Twig", "HTML+Twig"), + ("HTML+UL4", "HTML+UL4"), + ("HTML+Velocity", "HTML+Velocity"), + ("HTTP", "HTTP"), + ("Haml", "Haml"), + ("Handlebars", "Handlebars"), + ("Haskell", "Haskell"), + ("Haxe", "Haxe"), + ("Hexdump", "Hexdump"), + ("Hspec", "Hspec"), + ("Hxml", "Hxml"), + ("Hy", "Hy"), + ("Hybris", "Hybris"), + ("IDL", "IDL"), + ("INI", "INI"), + ("IRC logs", "IRC logs"), + ("Icon", "Icon"), + ("Idris", "Idris"), + ("Igor", "Igor"), + ("Inform 6", "Inform 6"), + ( + "Inform 6 template", + "Inform 6 template", + ), + ("Inform 7", "Inform 7"), + ("Io", "Io"), + ("Ioke", "Ioke"), + ("Isabelle", "Isabelle"), + ("J", "J"), + ("JAGS", "JAGS"), + ("JCL", "JCL"), + ("JSGF", "JSGF"), + ("JSLT", "JSLT"), + ("JSON", "JSON"), + ("JSON-LD", "JSON-LD"), + ( + "JSONBareObject", + "JSONBareObject", + ), + ("Jasmin", "Jasmin"), + ("Java", "Java"), + ( + "Java Server Page", + "Java Server Page", + ), + ("JavaScript", "JavaScript"), + ( + "JavaScript+Cheetah", + "JavaScript+Cheetah", + ), + ( + "JavaScript+Django/Jinja", + "JavaScript+Django/Jinja", + ), + ( + "JavaScript+Genshi Text", + "JavaScript+Genshi Text", + ), + ( + "JavaScript+Lasso", + "JavaScript+Lasso", + ), + ( + "JavaScript+Mako", + "JavaScript+Mako", + ), + ( + "JavaScript+Myghty", + "JavaScript+Myghty", + ), + ( + "JavaScript+PHP", + "JavaScript+PHP", + ), + ( + "JavaScript+Ruby", + "JavaScript+Ruby", + ), + ( + "JavaScript+Smarty", + "JavaScript+Smarty", + ), + ( + "Javascript+UL4", + "Javascript+UL4", + ), + ( + "Javascript+mozpreproc", + "Javascript+mozpreproc", + ), + ("Julia", "Julia"), + ("Julia console", "Julia console"), + ("Juttle", "Juttle"), + ("K", "K"), + ("Kal", "Kal"), + ("Kconfig", "Kconfig"), + ("Kernel log", "Kernel log"), + ("Koka", "Koka"), + ("Kotlin", "Kotlin"), + ("Kuin", "Kuin"), + ("LLVM", "LLVM"), + ("LLVM-MIR", "LLVM-MIR"), + ("LLVM-MIR Body", "LLVM-MIR Body"), + ("LSL", "LSL"), + ("Lasso", "Lasso"), + ("Lean", "Lean"), + ("LessCss", "LessCss"), + ( + "Lighttpd configuration file", + "Lighttpd configuration file", + ), + ("LilyPond", "LilyPond"), + ("Limbo", "Limbo"), + ("Literate Agda", "Literate Agda"), + ( + "Literate Cryptol", + "Literate Cryptol", + ), + ( + "Literate Haskell", + "Literate Haskell", + ), + ( + "Literate Idris", + "Literate Idris", + ), + ("LiveScript", "LiveScript"), + ("Logos", "Logos"), + ("Logtalk", "Logtalk"), + ("Lua", "Lua"), + ("MAQL", "MAQL"), + ("MCFunction", "MCFunction"), + ("MIME", "MIME"), + ("MOOCode", "MOOCode"), + ("MQL", "MQL"), + ("MSDOS Session", "MSDOS Session"), + ("MXML", "MXML"), + ("Macaulay2", "Macaulay2"), + ("Makefile", "Makefile"), + ("Mako", "Mako"), + ("Markdown", "Markdown"), + ("Mask", "Mask"), + ("Mason", "Mason"), + ("Mathematica", "Mathematica"), + ("Matlab", "Matlab"), + ( + "Matlab session", + "Matlab session", + ), + ("Maxima", "Maxima"), + ("Meson", "Meson"), + ("MiniD", "MiniD"), + ("MiniScript", "MiniScript"), + ("Modelica", "Modelica"), + ("Modula-2", "Modula-2"), + ( + "MoinMoin/Trac Wiki markup", + "MoinMoin/Trac Wiki markup", + ), + ("Monkey", "Monkey"), + ("Monte", "Monte"), + ("MoonScript", "MoonScript"), + ("Mosel", "Mosel"), + ("Mscgen", "Mscgen"), + ("MuPAD", "MuPAD"), + ("MySQL", "MySQL"), + ("Myghty", "Myghty"), + ("NASM", "NASM"), + ("NCL", "NCL"), + ("NSIS", "NSIS"), + ("Nemerle", "Nemerle"), + ("NestedText", "NestedText"), + ("NewLisp", "NewLisp"), + ("Newspeak", "Newspeak"), + ( + "Nginx configuration file", + "Nginx configuration file", + ), + ("Nimrod", "Nimrod"), + ("Nit", "Nit"), + ("Nix", "Nix"), + ( + "Node.js REPL console session", + "Node.js REPL console session", + ), + ("Notmuch", "Notmuch"), + ("NuSMV", "NuSMV"), + ("NumPy", "NumPy"), + ("OCaml", "OCaml"), + ("ODIN", "ODIN"), + ( + "OMG Interface Definition Language", + "OMG Interface Definition Language", + ), + ("Objective-C", "Objective-C"), + ("Objective-C++", "Objective-C++"), + ("Objective-J", "Objective-J"), + ("Octave", "Octave"), + ("Ooc", "Ooc"), + ("Opa", "Opa"), + ("OpenEdge ABL", "OpenEdge ABL"), + ("PEG", "PEG"), + ("PHP", "PHP"), + ("PL/pgSQL", "PL/pgSQL"), + ("POVRay", "POVRay"), + ("PacmanConf", "PacmanConf"), + ("Pan", "Pan"), + ("ParaSail", "ParaSail"), + ("Pawn", "Pawn"), + ("Perl", "Perl"), + ("Perl6", "Perl6"), + ("Pig", "Pig"), + ("Pike", "Pike"), + ("PkgConfig", "PkgConfig"), + ("Pointless", "Pointless"), + ("Pony", "Pony"), + ("PostScript", "PostScript"), + ( + "PostgreSQL SQL dialect", + "PostgreSQL SQL dialect", + ), + ( + "PostgreSQL console (psql)", + "PostgreSQL console (psql)", + ), + ("PowerShell", "PowerShell"), + ( + "PowerShell Session", + "PowerShell Session", + ), + ("Praat", "Praat"), + ("Procfile", "Procfile"), + ("Prolog", "Prolog"), + ("PromQL", "PromQL"), + ("Properties", "Properties"), + ( + "Protocol Buffer", + "Protocol Buffer", + ), + ( + "PsySH console session for PHP", + "PsySH console session for PHP", + ), + ("Pug", "Pug"), + ("Puppet", "Puppet"), + ("PyPy Log", "PyPy Log"), + ("Python", "Python"), + ("Python 2.x", "Python 2.x"), + ( + "Python 2.x Traceback", + "Python 2.x Traceback", + ), + ( + "Python Traceback", + "Python Traceback", + ), + ( + "Python console session", + "Python console session", + ), + ("Python+UL4", "Python+UL4"), + ("Q", "Q"), + ("QBasic", "QBasic"), + ("QML", "QML"), + ("QVTO", "QVTO"), + ("Qlik", "Qlik"), + ("RConsole", "RConsole"), + ("REBOL", "REBOL"), + ("RHTML", "RHTML"), + ("RPMSpec", "RPMSpec"), + ("RQL", "RQL"), + ("RSL", "RSL"), + ("Racket", "Racket"), + ("Ragel", "Ragel"), + ( + "Ragel in C Host", + "Ragel in C Host", + ), + ( + "Ragel in CPP Host", + "Ragel in CPP Host", + ), + ( + "Ragel in D Host", + "Ragel in D Host", + ), + ( + "Ragel in Java Host", + "Ragel in Java Host", + ), + ( + "Ragel in Objective C Host", + "Ragel in Objective C Host", + ), + ( + "Ragel in Ruby Host", + "Ragel in Ruby Host", + ), + ( + "Raw token data", + "Raw token data", + ), + ("Rd", "Rd"), + ("ReasonML", "ReasonML"), + ("Red", "Red"), + ("Redcode", "Redcode"), + ( + "Relax-NG Compact", + "Relax-NG Compact", + ), + ( + "ResourceBundle", + "ResourceBundle", + ), + ("Rexx", "Rexx"), + ("Ride", "Ride"), + ("Rita", "Rita"), + ( + "Roboconf Graph", + "Roboconf Graph", + ), + ( + "Roboconf Instances", + "Roboconf Instances", + ), + ( + "RobotFramework", + "RobotFramework", + ), + ("Ruby", "Ruby"), + ( + "Ruby irb session", + "Ruby irb session", + ), + ("Rust", "Rust"), + ("S", "S"), + ("SARL", "SARL"), + ("SAS", "SAS"), + ("SCSS", "SCSS"), + ("SNBT", "SNBT"), + ("SPARQL", "SPARQL"), + ("SQL", "SQL"), + ("SWIG", "SWIG"), + ("Sass", "Sass"), + ("Savi", "Savi"), + ("Scala", "Scala"), + ( + "Scalate Server Page", + "Scalate Server Page", + ), + ("Scaml", "Scaml"), + ("Scheme", "Scheme"), + ("Scilab", "Scilab"), + ("Sed", "Sed"), + ("ShExC", "ShExC"), + ("Shen", "Shen"), + ("Sieve", "Sieve"), + ("Silver", "Silver"), + ("Singularity", "Singularity"), + ("Slash", "Slash"), + ("Slim", "Slim"), + ("Slurm", "Slurm"), + ("Smali", "Smali"), + ("Smalltalk", "Smalltalk"), + ( + "SmartGameFormat", + "SmartGameFormat", + ), + ("Smarty", "Smarty"), + ("Smithy", "Smithy"), + ("Snobol", "Snobol"), + ("Snowball", "Snowball"), + ("Solidity", "Solidity"), + ("Sophia", "Sophia"), + ("SourcePawn", "SourcePawn"), + ("Spice", "Spice"), + ("SquidConf", "SquidConf"), + ("Srcinfo", "Srcinfo"), + ("Stan", "Stan"), + ("Standard ML", "Standard ML"), + ("Stata", "Stata"), + ("SuperCollider", "SuperCollider"), + ("Swift", "Swift"), + ("TADS 3", "TADS 3"), + ("TAP", "TAP"), + ("TASM", "TASM"), + ("TOML", "TOML"), + ("Tal", "Tal"), + ("Tcl", "Tcl"), + ("Tcsh", "Tcsh"), + ("Tcsh Session", "Tcsh Session"), + ("TeX", "TeX"), + ("Tea", "Tea"), + ( + "Tera Term macro", + "Tera Term macro", + ), + ("Termcap", "Termcap"), + ("Terminfo", "Terminfo"), + ("Terraform", "Terraform"), + ("Text only", "Text only"), + ("Text output", "Text output"), + ("ThingsDB", "ThingsDB"), + ("Thrift", "Thrift"), + ("Todotxt", "Todotxt"), + ("TrafficScript", "TrafficScript"), + ("Transact-SQL", "Transact-SQL"), + ("Treetop", "Treetop"), + ("Turtle", "Turtle"), + ("Twig", "Twig"), + ("TypeScript", "TypeScript"), + ("TypoScript", "TypoScript"), + ( + "TypoScriptCssData", + "TypoScriptCssData", + ), + ( + "TypoScriptHtmlData", + "TypoScriptHtmlData", + ), + ( + "Typographic Number Theory", + "Typographic Number Theory", + ), + ("UL4", "UL4"), + ("USD", "USD"), + ("Unicon", "Unicon"), + ( + "Unix/Linux config files", + "Unix/Linux config files", + ), + ("UrbiScript", "UrbiScript"), + ("VB.net", "VB.net"), + ("VBScript", "VBScript"), + ("VCL", "VCL"), + ("VCLSnippets", "VCLSnippets"), + ("VCTreeStatus", "VCTreeStatus"), + ("VGL", "VGL"), + ("Vala", "Vala"), + ("Velocity", "Velocity"), + ("VimL", "VimL"), + ("WDiff", "WDiff"), + ("Web IDL", "Web IDL"), + ("WebAssembly", "WebAssembly"), + ("Whiley", "Whiley"), + ("X10", "X10"), + ("XML", "XML"), + ("XML+Cheetah", "XML+Cheetah"), + ( + "XML+Django/Jinja", + "XML+Django/Jinja", + ), + ("XML+Evoque", "XML+Evoque"), + ("XML+Lasso", "XML+Lasso"), + ("XML+Mako", "XML+Mako"), + ("XML+Myghty", "XML+Myghty"), + ("XML+PHP", "XML+PHP"), + ("XML+Ruby", "XML+Ruby"), + ("XML+Smarty", "XML+Smarty"), + ("XML+UL4", "XML+UL4"), + ("XML+Velocity", "XML+Velocity"), + ("XQuery", "XQuery"), + ("XSLT", "XSLT"), + ( + "XUL+mozpreproc", + "XUL+mozpreproc", + ), + ("Xorg", "Xorg"), + ("Xtend", "Xtend"), + ("YAML", "YAML"), + ("YAML+Jinja", "YAML+Jinja"), + ("YANG", "YANG"), + ("Zeek", "Zeek"), + ("Zephir", "Zephir"), + ("Zig", "Zig"), + ("aspx-cs", "aspx-cs"), + ("aspx-vb", "aspx-vb"), + ("autohotkey", "autohotkey"), + ("c-objdump", "c-objdump"), + ("cADL", "cADL"), + ( + "ca65 assembler", + "ca65 assembler", + ), + ("cfstatement", "cfstatement"), + ("cplint", "cplint"), + ("cpp-objdump", "cpp-objdump"), + ("d-objdump", "d-objdump"), + ("dg", "dg"), + ("eC", "eC"), + ("execline", "execline"), + ("g-code", "g-code"), + ("liquid", "liquid"), + ( + "mozhashpreproc", + "mozhashpreproc", + ), + ( + "mozpercentpreproc", + "mozpercentpreproc", + ), + ("nesC", "nesC"), + ("objdump", "objdump"), + ("objdump-nasm", "objdump-nasm"), + ( + "reStructuredText", + "reStructuredText", + ), + ("reg", "reg"), + ("scdoc", "scdoc"), + ("sqlite3con", "sqlite3con"), + ("systemverilog", "systemverilog"), + ("teal", "teal"), + ("tiddler", "tiddler"), + ("ucode", "ucode"), + ("verilog", "verilog"), + ("vhdl", "vhdl"), + ("xtlang", "xtlang"), + ] + ), + ), + ("source", wagtail.blocks.TextBlock()), + ] + ), + ), + ( + "tangent", + wagtail.blocks.StructBlock( + [ + ( + "name", + wagtail.blocks.CharBlock(max_length=64), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + "code", + "strikethrough", + "snippet-link", + ] + ), + ), + ] + ), + ), + ( + "mermaid", + wagtail.blocks.StructBlock( + [ + ("source", wagtail.blocks.TextBlock()), + ( + "caption", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + "code", + "strikethrough", + "snippet-link", + ] + ), + ), + ] + ), + ), + ], + blank=True, + use_json_field=True, + ), + ), + ( + "hero_image", + models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.SET_NULL, + to="images.customimage", + ), + ), + ( + "hero_unsplash_photo", + models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.SET_NULL, + to="unsplash.unsplashphoto", + ), + ), + ], + options={ + "abstract": False, + }, + bases=("wagtailcore.page", models.Model), + ), + migrations.CreateModel( + name="BlogPostTagPage", + fields=[ + ( + "page_ptr", + models.OneToOneField( + auto_created=True, + on_delete=django.db.models.deletion.CASCADE, + parent_link=True, + primary_key=True, + serialize=False, + to="wagtailcore.page", + ), + ), + ("subtitle", models.CharField(blank=True, max_length=255)), + ( + "body", + wagtail.fields.StreamField( + [ + ("embed", wagtail.embeds.blocks.EmbedBlock()), + ( + "rich_text", + wagtail.blocks.RichTextBlock( + features=[ + "h2", + "h3", + "h4", + "h5", + "h6", + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + "code", + "strikethrough", + "snippet-link", + "snippet-embed", + ] + ), + ), + ( + "lorem", + wagtail.blocks.StructBlock( + [ + ( + "paragraphs", + wagtail.blocks.IntegerBlock(min_value=1), + ) + ] + ), + ), + ("html", wagtail.blocks.RawHTMLBlock()), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock(), + ), + ( + "caption", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + "code", + "strikethrough", + "snippet-link", + ] + ), + ), + ] + ), + ), + ( + "code", + wagtail.blocks.StructBlock( + [ + ( + "language", + wagtail.blocks.ChoiceBlock( + choices=[ + ("ABAP", "ABAP"), + ("ABNF", "ABNF"), + ("ADL", "ADL"), + ("AMDGPU", "AMDGPU"), + ( + "ANSYS parametric design language", + "ANSYS parametric design language", + ), + ("ANTLR", "ANTLR"), + ( + "ANTLR With ActionScript Target", + "ANTLR With ActionScript Target", + ), + ( + "ANTLR With C# Target", + "ANTLR With C# Target", + ), + ( + "ANTLR With CPP Target", + "ANTLR With CPP Target", + ), + ( + "ANTLR With Java Target", + "ANTLR With Java Target", + ), + ( + "ANTLR With ObjectiveC Target", + "ANTLR With ObjectiveC Target", + ), + ( + "ANTLR With Perl Target", + "ANTLR With Perl Target", + ), + ( + "ANTLR With Python Target", + "ANTLR With Python Target", + ), + ( + "ANTLR With Ruby Target", + "ANTLR With Ruby Target", + ), + ("APL", "APL"), + ("ASCII armored", "ASCII armored"), + ("ActionScript", "ActionScript"), + ( + "ActionScript 3", + "ActionScript 3", + ), + ("Ada", "Ada"), + ("Agda", "Agda"), + ("Aheui", "Aheui"), + ("Alloy", "Alloy"), + ("AmbientTalk", "AmbientTalk"), + ("Ampl", "Ampl"), + ("Angular2", "Angular2"), + ("ApacheConf", "ApacheConf"), + ("AppleScript", "AppleScript"), + ("Arduino", "Arduino"), + ("Arrow", "Arrow"), + ("AspectJ", "AspectJ"), + ("Asymptote", "Asymptote"), + ("Augeas", "Augeas"), + ("AutoIt", "AutoIt"), + ("Awk", "Awk"), + ("BARE", "BARE"), + ("BBC Basic", "BBC Basic"), + ("BBCode", "BBCode"), + ("BC", "BC"), + ("BNF", "BNF"), + ("BST", "BST"), + ("BUGS", "BUGS"), + ("Base Makefile", "Base Makefile"), + ("Bash", "Bash"), + ("Bash Session", "Bash Session"), + ("Batchfile", "Batchfile"), + ("Bdd", "Bdd"), + ("Befunge", "Befunge"), + ("Berry", "Berry"), + ("BibTeX", "BibTeX"), + ("BlitzBasic", "BlitzBasic"), + ("BlitzMax", "BlitzMax"), + ("Boa", "Boa"), + ("Boo", "Boo"), + ("Boogie", "Boogie"), + ("Brainfuck", "Brainfuck"), + ("C", "C"), + ("C#", "C#"), + ("C++", "C++"), + ("CAmkES", "CAmkES"), + ("CBM BASIC V2", "CBM BASIC V2"), + ("CDDL", "CDDL"), + ("CFEngine3", "CFEngine3"), + ("CMake", "CMake"), + ("COBOL", "COBOL"), + ("COBOLFree", "COBOLFree"), + ("CPSA", "CPSA"), + ("CSS", "CSS"), + ( + "CSS+Django/Jinja", + "CSS+Django/Jinja", + ), + ( + "CSS+Genshi Text", + "CSS+Genshi Text", + ), + ("CSS+Lasso", "CSS+Lasso"), + ("CSS+Mako", "CSS+Mako"), + ("CSS+Myghty", "CSS+Myghty"), + ("CSS+PHP", "CSS+PHP"), + ("CSS+Ruby", "CSS+Ruby"), + ("CSS+Smarty", "CSS+Smarty"), + ("CSS+UL4", "CSS+UL4"), + ( + "CSS+mozpreproc", + "CSS+mozpreproc", + ), + ("CUDA", "CUDA"), + ("Cap'n Proto", "Cap'n Proto"), + ("CapDL", "CapDL"), + ("Ceylon", "Ceylon"), + ("ChaiScript", "ChaiScript"), + ("Chapel", "Chapel"), + ("Charmci", "Charmci"), + ("Cheetah", "Cheetah"), + ("Cirru", "Cirru"), + ("Clay", "Clay"), + ("Clean", "Clean"), + ("Clojure", "Clojure"), + ("ClojureScript", "ClojureScript"), + ("CoffeeScript", "CoffeeScript"), + ( + "Coldfusion CFC", + "Coldfusion CFC", + ), + ( + "Coldfusion HTML", + "Coldfusion HTML", + ), + ("Common Lisp", "Common Lisp"), + ( + "Component Pascal", + "Component Pascal", + ), + ("Coq", "Coq"), + ("Crmsh", "Crmsh"), + ("Croc", "Croc"), + ("Cryptol", "Cryptol"), + ("Crystal", "Crystal"), + ( + "Csound Document", + "Csound Document", + ), + ( + "Csound Orchestra", + "Csound Orchestra", + ), + ("Csound Score", "Csound Score"), + ("Cypher", "Cypher"), + ("Cython", "Cython"), + ("D", "D"), + ("DASM16", "DASM16"), + ("DTD", "DTD"), + ("Darcs Patch", "Darcs Patch"), + ("Dart", "Dart"), + ( + "Debian Control file", + "Debian Control file", + ), + ( + "Debian Sourcelist", + "Debian Sourcelist", + ), + ("Delphi", "Delphi"), + ("Devicetree", "Devicetree"), + ("Diff", "Diff"), + ("Django/Jinja", "Django/Jinja"), + ("Docker", "Docker"), + ("Duel", "Duel"), + ("Dylan", "Dylan"), + ("Dylan session", "Dylan session"), + ("DylanLID", "DylanLID"), + ("E-mail", "E-mail"), + ("EBNF", "EBNF"), + ("ECL", "ECL"), + ("ERB", "ERB"), + ("Earl Grey", "Earl Grey"), + ("Easytrieve", "Easytrieve"), + ("Eiffel", "Eiffel"), + ("Elixir", "Elixir"), + ( + "Elixir iex session", + "Elixir iex session", + ), + ("Elm", "Elm"), + ("Elpi", "Elpi"), + ("EmacsLisp", "EmacsLisp"), + ( + "Embedded Ragel", + "Embedded Ragel", + ), + ("Erlang", "Erlang"), + ( + "Erlang erl session", + "Erlang erl session", + ), + ("Evoque", "Evoque"), + ("Ezhil", "Ezhil"), + ("F#", "F#"), + ("FStar", "FStar"), + ("Factor", "Factor"), + ("Fancy", "Fancy"), + ("Fantom", "Fantom"), + ("Felix", "Felix"), + ("Fennel", "Fennel"), + ("Fish", "Fish"), + ("Flatline", "Flatline"), + ("FloScript", "FloScript"), + ("Forth", "Forth"), + ("Fortran", "Fortran"), + ("FortranFixed", "FortranFixed"), + ("FoxPro", "FoxPro"), + ("Freefem", "Freefem"), + ("Futhark", "Futhark"), + ("GAP", "GAP"), + ("GAS", "GAS"), + ("GDScript", "GDScript"), + ("GLSL", "GLSL"), + ("GSQL", "GSQL"), + ("Genshi", "Genshi"), + ("Genshi Text", "Genshi Text"), + ( + "Gettext Catalog", + "Gettext Catalog", + ), + ("Gherkin", "Gherkin"), + ("Gnuplot", "Gnuplot"), + ("Go", "Go"), + ("Golo", "Golo"), + ("GoodData-CL", "GoodData-CL"), + ("Gosu", "Gosu"), + ("Gosu Template", "Gosu Template"), + ("Graphviz", "Graphviz"), + ("Groff", "Groff"), + ("Groovy", "Groovy"), + ("HLSL", "HLSL"), + ("HSAIL", "HSAIL"), + ("HTML", "HTML"), + ( + "HTML + Angular2", + "HTML + Angular2", + ), + ("HTML+Cheetah", "HTML+Cheetah"), + ( + "HTML+Django/Jinja", + "HTML+Django/Jinja", + ), + ("HTML+Evoque", "HTML+Evoque"), + ("HTML+Genshi", "HTML+Genshi"), + ( + "HTML+Handlebars", + "HTML+Handlebars", + ), + ("HTML+Lasso", "HTML+Lasso"), + ("HTML+Mako", "HTML+Mako"), + ("HTML+Myghty", "HTML+Myghty"), + ("HTML+PHP", "HTML+PHP"), + ("HTML+Smarty", "HTML+Smarty"), + ("HTML+Twig", "HTML+Twig"), + ("HTML+UL4", "HTML+UL4"), + ("HTML+Velocity", "HTML+Velocity"), + ("HTTP", "HTTP"), + ("Haml", "Haml"), + ("Handlebars", "Handlebars"), + ("Haskell", "Haskell"), + ("Haxe", "Haxe"), + ("Hexdump", "Hexdump"), + ("Hspec", "Hspec"), + ("Hxml", "Hxml"), + ("Hy", "Hy"), + ("Hybris", "Hybris"), + ("IDL", "IDL"), + ("INI", "INI"), + ("IRC logs", "IRC logs"), + ("Icon", "Icon"), + ("Idris", "Idris"), + ("Igor", "Igor"), + ("Inform 6", "Inform 6"), + ( + "Inform 6 template", + "Inform 6 template", + ), + ("Inform 7", "Inform 7"), + ("Io", "Io"), + ("Ioke", "Ioke"), + ("Isabelle", "Isabelle"), + ("J", "J"), + ("JAGS", "JAGS"), + ("JCL", "JCL"), + ("JSGF", "JSGF"), + ("JSLT", "JSLT"), + ("JSON", "JSON"), + ("JSON-LD", "JSON-LD"), + ( + "JSONBareObject", + "JSONBareObject", + ), + ("Jasmin", "Jasmin"), + ("Java", "Java"), + ( + "Java Server Page", + "Java Server Page", + ), + ("JavaScript", "JavaScript"), + ( + "JavaScript+Cheetah", + "JavaScript+Cheetah", + ), + ( + "JavaScript+Django/Jinja", + "JavaScript+Django/Jinja", + ), + ( + "JavaScript+Genshi Text", + "JavaScript+Genshi Text", + ), + ( + "JavaScript+Lasso", + "JavaScript+Lasso", + ), + ( + "JavaScript+Mako", + "JavaScript+Mako", + ), + ( + "JavaScript+Myghty", + "JavaScript+Myghty", + ), + ( + "JavaScript+PHP", + "JavaScript+PHP", + ), + ( + "JavaScript+Ruby", + "JavaScript+Ruby", + ), + ( + "JavaScript+Smarty", + "JavaScript+Smarty", + ), + ( + "Javascript+UL4", + "Javascript+UL4", + ), + ( + "Javascript+mozpreproc", + "Javascript+mozpreproc", + ), + ("Julia", "Julia"), + ("Julia console", "Julia console"), + ("Juttle", "Juttle"), + ("K", "K"), + ("Kal", "Kal"), + ("Kconfig", "Kconfig"), + ("Kernel log", "Kernel log"), + ("Koka", "Koka"), + ("Kotlin", "Kotlin"), + ("Kuin", "Kuin"), + ("LLVM", "LLVM"), + ("LLVM-MIR", "LLVM-MIR"), + ("LLVM-MIR Body", "LLVM-MIR Body"), + ("LSL", "LSL"), + ("Lasso", "Lasso"), + ("Lean", "Lean"), + ("LessCss", "LessCss"), + ( + "Lighttpd configuration file", + "Lighttpd configuration file", + ), + ("LilyPond", "LilyPond"), + ("Limbo", "Limbo"), + ("Literate Agda", "Literate Agda"), + ( + "Literate Cryptol", + "Literate Cryptol", + ), + ( + "Literate Haskell", + "Literate Haskell", + ), + ( + "Literate Idris", + "Literate Idris", + ), + ("LiveScript", "LiveScript"), + ("Logos", "Logos"), + ("Logtalk", "Logtalk"), + ("Lua", "Lua"), + ("MAQL", "MAQL"), + ("MCFunction", "MCFunction"), + ("MIME", "MIME"), + ("MOOCode", "MOOCode"), + ("MQL", "MQL"), + ("MSDOS Session", "MSDOS Session"), + ("MXML", "MXML"), + ("Macaulay2", "Macaulay2"), + ("Makefile", "Makefile"), + ("Mako", "Mako"), + ("Markdown", "Markdown"), + ("Mask", "Mask"), + ("Mason", "Mason"), + ("Mathematica", "Mathematica"), + ("Matlab", "Matlab"), + ( + "Matlab session", + "Matlab session", + ), + ("Maxima", "Maxima"), + ("Meson", "Meson"), + ("MiniD", "MiniD"), + ("MiniScript", "MiniScript"), + ("Modelica", "Modelica"), + ("Modula-2", "Modula-2"), + ( + "MoinMoin/Trac Wiki markup", + "MoinMoin/Trac Wiki markup", + ), + ("Monkey", "Monkey"), + ("Monte", "Monte"), + ("MoonScript", "MoonScript"), + ("Mosel", "Mosel"), + ("Mscgen", "Mscgen"), + ("MuPAD", "MuPAD"), + ("MySQL", "MySQL"), + ("Myghty", "Myghty"), + ("NASM", "NASM"), + ("NCL", "NCL"), + ("NSIS", "NSIS"), + ("Nemerle", "Nemerle"), + ("NestedText", "NestedText"), + ("NewLisp", "NewLisp"), + ("Newspeak", "Newspeak"), + ( + "Nginx configuration file", + "Nginx configuration file", + ), + ("Nimrod", "Nimrod"), + ("Nit", "Nit"), + ("Nix", "Nix"), + ( + "Node.js REPL console session", + "Node.js REPL console session", + ), + ("Notmuch", "Notmuch"), + ("NuSMV", "NuSMV"), + ("NumPy", "NumPy"), + ("OCaml", "OCaml"), + ("ODIN", "ODIN"), + ( + "OMG Interface Definition Language", + "OMG Interface Definition Language", + ), + ("Objective-C", "Objective-C"), + ("Objective-C++", "Objective-C++"), + ("Objective-J", "Objective-J"), + ("Octave", "Octave"), + ("Ooc", "Ooc"), + ("Opa", "Opa"), + ("OpenEdge ABL", "OpenEdge ABL"), + ("PEG", "PEG"), + ("PHP", "PHP"), + ("PL/pgSQL", "PL/pgSQL"), + ("POVRay", "POVRay"), + ("PacmanConf", "PacmanConf"), + ("Pan", "Pan"), + ("ParaSail", "ParaSail"), + ("Pawn", "Pawn"), + ("Perl", "Perl"), + ("Perl6", "Perl6"), + ("Pig", "Pig"), + ("Pike", "Pike"), + ("PkgConfig", "PkgConfig"), + ("Pointless", "Pointless"), + ("Pony", "Pony"), + ("PostScript", "PostScript"), + ( + "PostgreSQL SQL dialect", + "PostgreSQL SQL dialect", + ), + ( + "PostgreSQL console (psql)", + "PostgreSQL console (psql)", + ), + ("PowerShell", "PowerShell"), + ( + "PowerShell Session", + "PowerShell Session", + ), + ("Praat", "Praat"), + ("Procfile", "Procfile"), + ("Prolog", "Prolog"), + ("PromQL", "PromQL"), + ("Properties", "Properties"), + ( + "Protocol Buffer", + "Protocol Buffer", + ), + ( + "PsySH console session for PHP", + "PsySH console session for PHP", + ), + ("Pug", "Pug"), + ("Puppet", "Puppet"), + ("PyPy Log", "PyPy Log"), + ("Python", "Python"), + ("Python 2.x", "Python 2.x"), + ( + "Python 2.x Traceback", + "Python 2.x Traceback", + ), + ( + "Python Traceback", + "Python Traceback", + ), + ( + "Python console session", + "Python console session", + ), + ("Python+UL4", "Python+UL4"), + ("Q", "Q"), + ("QBasic", "QBasic"), + ("QML", "QML"), + ("QVTO", "QVTO"), + ("Qlik", "Qlik"), + ("RConsole", "RConsole"), + ("REBOL", "REBOL"), + ("RHTML", "RHTML"), + ("RPMSpec", "RPMSpec"), + ("RQL", "RQL"), + ("RSL", "RSL"), + ("Racket", "Racket"), + ("Ragel", "Ragel"), + ( + "Ragel in C Host", + "Ragel in C Host", + ), + ( + "Ragel in CPP Host", + "Ragel in CPP Host", + ), + ( + "Ragel in D Host", + "Ragel in D Host", + ), + ( + "Ragel in Java Host", + "Ragel in Java Host", + ), + ( + "Ragel in Objective C Host", + "Ragel in Objective C Host", + ), + ( + "Ragel in Ruby Host", + "Ragel in Ruby Host", + ), + ( + "Raw token data", + "Raw token data", + ), + ("Rd", "Rd"), + ("ReasonML", "ReasonML"), + ("Red", "Red"), + ("Redcode", "Redcode"), + ( + "Relax-NG Compact", + "Relax-NG Compact", + ), + ( + "ResourceBundle", + "ResourceBundle", + ), + ("Rexx", "Rexx"), + ("Ride", "Ride"), + ("Rita", "Rita"), + ( + "Roboconf Graph", + "Roboconf Graph", + ), + ( + "Roboconf Instances", + "Roboconf Instances", + ), + ( + "RobotFramework", + "RobotFramework", + ), + ("Ruby", "Ruby"), + ( + "Ruby irb session", + "Ruby irb session", + ), + ("Rust", "Rust"), + ("S", "S"), + ("SARL", "SARL"), + ("SAS", "SAS"), + ("SCSS", "SCSS"), + ("SNBT", "SNBT"), + ("SPARQL", "SPARQL"), + ("SQL", "SQL"), + ("SWIG", "SWIG"), + ("Sass", "Sass"), + ("Savi", "Savi"), + ("Scala", "Scala"), + ( + "Scalate Server Page", + "Scalate Server Page", + ), + ("Scaml", "Scaml"), + ("Scheme", "Scheme"), + ("Scilab", "Scilab"), + ("Sed", "Sed"), + ("ShExC", "ShExC"), + ("Shen", "Shen"), + ("Sieve", "Sieve"), + ("Silver", "Silver"), + ("Singularity", "Singularity"), + ("Slash", "Slash"), + ("Slim", "Slim"), + ("Slurm", "Slurm"), + ("Smali", "Smali"), + ("Smalltalk", "Smalltalk"), + ( + "SmartGameFormat", + "SmartGameFormat", + ), + ("Smarty", "Smarty"), + ("Smithy", "Smithy"), + ("Snobol", "Snobol"), + ("Snowball", "Snowball"), + ("Solidity", "Solidity"), + ("Sophia", "Sophia"), + ("SourcePawn", "SourcePawn"), + ("Spice", "Spice"), + ("SquidConf", "SquidConf"), + ("Srcinfo", "Srcinfo"), + ("Stan", "Stan"), + ("Standard ML", "Standard ML"), + ("Stata", "Stata"), + ("SuperCollider", "SuperCollider"), + ("Swift", "Swift"), + ("TADS 3", "TADS 3"), + ("TAP", "TAP"), + ("TASM", "TASM"), + ("TOML", "TOML"), + ("Tal", "Tal"), + ("Tcl", "Tcl"), + ("Tcsh", "Tcsh"), + ("Tcsh Session", "Tcsh Session"), + ("TeX", "TeX"), + ("Tea", "Tea"), + ( + "Tera Term macro", + "Tera Term macro", + ), + ("Termcap", "Termcap"), + ("Terminfo", "Terminfo"), + ("Terraform", "Terraform"), + ("Text only", "Text only"), + ("Text output", "Text output"), + ("ThingsDB", "ThingsDB"), + ("Thrift", "Thrift"), + ("Todotxt", "Todotxt"), + ("TrafficScript", "TrafficScript"), + ("Transact-SQL", "Transact-SQL"), + ("Treetop", "Treetop"), + ("Turtle", "Turtle"), + ("Twig", "Twig"), + ("TypeScript", "TypeScript"), + ("TypoScript", "TypoScript"), + ( + "TypoScriptCssData", + "TypoScriptCssData", + ), + ( + "TypoScriptHtmlData", + "TypoScriptHtmlData", + ), + ( + "Typographic Number Theory", + "Typographic Number Theory", + ), + ("UL4", "UL4"), + ("USD", "USD"), + ("Unicon", "Unicon"), + ( + "Unix/Linux config files", + "Unix/Linux config files", + ), + ("UrbiScript", "UrbiScript"), + ("VB.net", "VB.net"), + ("VBScript", "VBScript"), + ("VCL", "VCL"), + ("VCLSnippets", "VCLSnippets"), + ("VCTreeStatus", "VCTreeStatus"), + ("VGL", "VGL"), + ("Vala", "Vala"), + ("Velocity", "Velocity"), + ("VimL", "VimL"), + ("WDiff", "WDiff"), + ("Web IDL", "Web IDL"), + ("WebAssembly", "WebAssembly"), + ("Whiley", "Whiley"), + ("X10", "X10"), + ("XML", "XML"), + ("XML+Cheetah", "XML+Cheetah"), + ( + "XML+Django/Jinja", + "XML+Django/Jinja", + ), + ("XML+Evoque", "XML+Evoque"), + ("XML+Lasso", "XML+Lasso"), + ("XML+Mako", "XML+Mako"), + ("XML+Myghty", "XML+Myghty"), + ("XML+PHP", "XML+PHP"), + ("XML+Ruby", "XML+Ruby"), + ("XML+Smarty", "XML+Smarty"), + ("XML+UL4", "XML+UL4"), + ("XML+Velocity", "XML+Velocity"), + ("XQuery", "XQuery"), + ("XSLT", "XSLT"), + ( + "XUL+mozpreproc", + "XUL+mozpreproc", + ), + ("Xorg", "Xorg"), + ("Xtend", "Xtend"), + ("YAML", "YAML"), + ("YAML+Jinja", "YAML+Jinja"), + ("YANG", "YANG"), + ("Zeek", "Zeek"), + ("Zephir", "Zephir"), + ("Zig", "Zig"), + ("aspx-cs", "aspx-cs"), + ("aspx-vb", "aspx-vb"), + ("autohotkey", "autohotkey"), + ("c-objdump", "c-objdump"), + ("cADL", "cADL"), + ( + "ca65 assembler", + "ca65 assembler", + ), + ("cfstatement", "cfstatement"), + ("cplint", "cplint"), + ("cpp-objdump", "cpp-objdump"), + ("d-objdump", "d-objdump"), + ("dg", "dg"), + ("eC", "eC"), + ("execline", "execline"), + ("g-code", "g-code"), + ("liquid", "liquid"), + ( + "mozhashpreproc", + "mozhashpreproc", + ), + ( + "mozpercentpreproc", + "mozpercentpreproc", + ), + ("nesC", "nesC"), + ("objdump", "objdump"), + ("objdump-nasm", "objdump-nasm"), + ( + "reStructuredText", + "reStructuredText", + ), + ("reg", "reg"), + ("scdoc", "scdoc"), + ("sqlite3con", "sqlite3con"), + ("systemverilog", "systemverilog"), + ("teal", "teal"), + ("tiddler", "tiddler"), + ("ucode", "ucode"), + ("verilog", "verilog"), + ("vhdl", "vhdl"), + ("xtlang", "xtlang"), + ] + ), + ), + ("source", wagtail.blocks.TextBlock()), + ] + ), + ), + ( + "tangent", + wagtail.blocks.StructBlock( + [ + ( + "name", + wagtail.blocks.CharBlock(max_length=64), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + "code", + "strikethrough", + "snippet-link", + ] + ), + ), + ] + ), + ), + ( + "mermaid", + wagtail.blocks.StructBlock( + [ + ("source", wagtail.blocks.TextBlock()), + ( + "caption", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + "code", + "strikethrough", + "snippet-link", + ] + ), + ), + ] + ), + ), + ], + blank=True, + use_json_field=True, + ), + ), + ( + "hero_image", + models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.SET_NULL, + to="images.customimage", + ), + ), + ( + "hero_unsplash_photo", + models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.SET_NULL, + to="unsplash.unsplashphoto", + ), + ), + ], + options={ + "abstract": False, + }, + bases=("wagtailcore.page", models.Model), + ), + migrations.RemoveField( + model_name="taggedblog", + name="content_object", + ), + migrations.RemoveField( + model_name="taggedblog", + name="tag", + ), + migrations.RemoveField( + model_name="blogpostpage", + name="tags", + ), + migrations.DeleteModel( + name="BlogPostTag", + ), + migrations.DeleteModel( + name="TaggedBlog", + ), + ] diff --git a/website/blog/migrations/0015_blogpostpage_tags.py b/website/blog/migrations/0015_blogpostpage_tags.py new file mode 100644 index 0000000..5b2faaa --- /dev/null +++ b/website/blog/migrations/0015_blogpostpage_tags.py @@ -0,0 +1,21 @@ +# Generated by Django 4.0.5 on 2022-07-16 08:37 + +import modelcluster.fields +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("blog", "0014_blogposttaglistpage_blogposttagpage_and_more"), + ] + + operations = [ + migrations.AddField( + model_name="blogpostpage", + name="tags", + field=modelcluster.fields.ParentalManyToManyField( + blank=True, to="blog.blogposttagpage" + ), + ), + ] diff --git a/website/blog/models.py b/website/blog/models.py index c5b9b5c..e42bc4c 100644 --- a/website/blog/models.py +++ b/website/blog/models.py @@ -5,9 +5,7 @@ from django.db.models.functions import TruncMonth from django.http.request import HttpRequest from django.utils import timezone from django.utils.functional import cached_property -from modelcluster.contrib.taggit import ClusterTaggableManager -from modelcluster.fields import ParentalKey -from taggit.models import ItemBase, TagBase +from modelcluster.fields import ParentalManyToManyField from wagtail.admin.panels import FieldPanel from wagtail.query import PageQuerySet @@ -17,7 +15,7 @@ from website.common.utils import TocEntry class BlogListPage(BaseContentMixin, BasePage): # type: ignore[misc] max_count = 1 - subpage_types = ["blog.BlogPostPage"] + subpage_types = ["blog.BlogPostPage", "blog.BlogPostTagListPage"] content_panels = BasePage.content_panels + BaseContentMixin.content_panels @cached_property @@ -31,8 +29,7 @@ class BlogListPage(BaseContentMixin, BasePage): # type: ignore[misc] def table_of_contents(self) -> list[TocEntry]: post_months = [ dt.strftime("%Y-%m") - for dt in self.get_children() - .live() + for dt in self.get_blog_posts() .annotate(post_month=TruncMonth("date", output_field=models.DateField())) .order_by("-post_month") .values_list("post_month", flat=True) @@ -41,62 +38,26 @@ class BlogListPage(BaseContentMixin, BasePage): # type: ignore[misc] return [TocEntry(post_month, post_month, 0, []) for post_month in post_months] - def get_children(self) -> PageQuerySet: - """ - Since the children are always `BlogPostPage`, so juts use the specific queryset to save the `JOIN`. - """ - return BlogPostPage.objects.child_of(self) # type: ignore[attr-defined] + def get_blog_posts(self) -> PageQuerySet: + return BlogPostPage.objects.child_of(self).live() # type:ignore[attr-defined] def get_context(self, request: HttpRequest) -> dict: context = super().get_context(request) context["child_pages"] = ( - self.get_children() - .live() + self.get_blog_posts() .select_related("hero_image") .select_related("hero_unsplash_photo") .prefetch_related("tags") .order_by("-date") ) - if tag := request.GET.get("tag"): - tag = BlogPostTag.objects.filter(slug=tag).first() - if tag: - context["filtering_by_tag"] = tag - context["no_table_of_contents"] = True - context["child_pages"] = context["child_pages"].filter(tags=tag) return context -class BlogPostTag(TagBase): - free_tagging = False - - panels = [FieldPanel("name")] - - class Meta: - verbose_name = "blog tag" - verbose_name_plural = "blog tags" - - def get_absolute_url(self) -> str: - return ( - BlogListPage.objects.live().defer_streamfields().first().get_url() # type: ignore[attr-defined] - + "?tag=" - + self.slug - ) - - -class TaggedBlog(ItemBase): - tag = models.ForeignKey( - BlogPostTag, related_name="tagged_blogs", on_delete=models.CASCADE - ) - content_object = ParentalKey( - "blog.BlogPostPage", on_delete=models.CASCADE, related_name="tagged_items" - ) - - class BlogPostPage(BaseContentMixin, BasePage): # type: ignore[misc] subpage_types: list[Any] = [] parent_page_types = [BlogListPage] - tags = ClusterTaggableManager(through=TaggedBlog, blank=True) + tags = ParentalManyToManyField("blog.BlogPostTagPage", blank=True) date = models.DateField(default=timezone.now) content_panels = ( @@ -104,3 +65,46 @@ class BlogPostPage(BaseContentMixin, BasePage): # type: ignore[misc] + BaseContentMixin.content_panels + [FieldPanel("date"), FieldPanel("tags")] ) + + +class BlogPostTagListPage(BaseContentMixin, BasePage): # type: ignore[misc] + max_count = 1 + parent_page_types = [BlogListPage] + subpage_types = ["blog.BlogPostTagPage"] + + content_panels = BasePage.content_panels + BaseContentMixin.content_panels + + @cached_property + def table_of_contents(self) -> list[TocEntry]: + return [TocEntry(page.title, page.slug, 0, []) for page in self.get_tags()] + + def get_tags(self) -> PageQuerySet: + return self.get_children().specific().live().order_by("title") + + def get_context(self, request: HttpRequest) -> dict: + context = super().get_context(request) + context["tags"] = self.get_children().specific().live().order_by("title") + return context + + +class BlogPostTagPage(BaseContentMixin, BasePage): # type: ignore[misc] + subpage_types: list[Any] = [] + parent_page_types = [BlogPostTagListPage] + + content_panels = BasePage.content_panels + BaseContentMixin.content_panels + + @cached_property + def table_of_contents(self) -> list[TocEntry]: + return [ + TocEntry(page.title, page.slug, 0, []) for page in self.get_blog_posts() + ] + + def get_blog_posts(self) -> PageQuerySet: + blog_list_page = self.get_parent_pages().specific().reverse()[1] + assert isinstance(blog_list_page, BlogListPage) + return blog_list_page.get_blog_posts().filter(tags=self).order_by("-date") + + def get_context(self, request: HttpRequest) -> dict: + context = super().get_context(request) + context["pages"] = self.get_blog_posts() + return context diff --git a/website/blog/templates/blog/blog_list_page.html b/website/blog/templates/blog/blog_list_page.html index a56f7a8..77c79fc 100644 --- a/website/blog/templates/blog/blog_list_page.html +++ b/website/blog/templates/blog/blog_list_page.html @@ -1,23 +1,9 @@ {% extends "wagtail_base.html" %} -{% load wagtailcore_tags %} - {% block content %} {% include "common/hero.html" %} -{% if filtering_by_tag %} -
-

- Showing only: - - #{{ filtering_by_tag.name }} - - -

-
-{% endif %} -
{% for page in child_pages %} {% if not filtering_by_tag %} diff --git a/website/blog/templates/blog/blog_post_tag_list_page.html b/website/blog/templates/blog/blog_post_tag_list_page.html new file mode 100644 index 0000000..a21f630 --- /dev/null +++ b/website/blog/templates/blog/blog_post_tag_list_page.html @@ -0,0 +1,13 @@ +{% extends "wagtail_base.html" %} + +{% block content %} + +{% include "common/hero.html" %} + +
+ {% for tag in tags %} + {% include "common/listing-item.html" with page=tag %} + {% endfor %} +
+ +{% endblock content %} diff --git a/website/blog/templates/blog/blog_post_tag_page.html b/website/blog/templates/blog/blog_post_tag_page.html new file mode 100644 index 0000000..08dd01e --- /dev/null +++ b/website/blog/templates/blog/blog_post_tag_page.html @@ -0,0 +1,13 @@ +{% extends "wagtail_base.html" %} + +{% block content %} + +{% include "common/hero.html" %} + +
+ {% for page in pages %} + {% include "common/listing-item.html" %} + {% endfor %} +
+ +{% endblock content %} diff --git a/website/blog/wagtail_hooks.py b/website/blog/wagtail_hooks.py index 2db5246..891babb 100644 --- a/website/blog/wagtail_hooks.py +++ b/website/blog/wagtail_hooks.py @@ -1,14 +1,19 @@ -from wagtail.contrib.modeladmin.options import ModelAdmin, modeladmin_register +from django.urls import reverse +from wagtail import hooks +from wagtail.admin.menu import MenuItem -from .models import BlogPostTag +from .models import BlogPostTagListPage -class BlogPostTagModelAdmin(ModelAdmin): - model = BlogPostTag - menu_label = "Blog Post Tags" - menu_icon = "tag" - list_display = ["name", "slug"] - search_fields = ["name", "slug"] - - -modeladmin_register(BlogPostTagModelAdmin) +@hooks.register("register_admin_menu_item") +def register_blog_post_tags_menu_item() -> MenuItem: + blog_post_tag_list_id = ( + BlogPostTagListPage.objects.live() # type:ignore[attr-defined] + .values_list("id", flat=True) + .get() + ) + return MenuItem( + "Blog post tags", + reverse("wagtailadmin_explore", args=[blog_post_tag_list_id]), + icon_name="tag", + ) diff --git a/website/common/templates/common/content-details.html b/website/common/templates/common/content-details.html index 40d0ecc..738d693 100644 --- a/website/common/templates/common/content-details.html +++ b/website/common/templates/common/content-details.html @@ -1,4 +1,4 @@ - +{% load wagtailcore_tags %}
@@ -25,7 +25,7 @@
{% for tag in page.tags.all %} - #{{ tag.slug }} + #{{ tag.slug }} {% endfor %}