From 0d15fdbe74c2fa34a78170670f857845d4a69842 Mon Sep 17 00:00:00 2001 From: Folyd Date: Mon, 3 Jul 2023 13:31:13 +0800 Subject: [PATCH 1/2] Load footer data from json --- footer.json | 38 ++++++++++++++++++++++++++++++++++++++ static/footer.css | 2 +- templates/footer.html | 33 +++++++++++++-------------------- 3 files changed, 52 insertions(+), 21 deletions(-) create mode 100644 footer.json diff --git a/footer.json b/footer.json new file mode 100644 index 0000000..4e6a607 --- /dev/null +++ b/footer.json @@ -0,0 +1,38 @@ +{ + "magazine": [ + { + "name": "All topics", + "url": "/topics" + }, + { + "name": "All authors", + "url": "/authors" + } + ], + "more": [ + { + "name": "About", + "url": "/about" + }, + { + "name": "FAQ", + "url": "/faq" + }, + { + "name": "Open Collective", + "url": "https://opencollective.com/rustmagazine" + }, + { + "name": "How to contribute", + "url": "/contribution" + }, + { + "name": "GitHub", + "url": "https://github.com/RustMagazine/rustmagazine" + }, + { + "name": "Discord", + "url": "https://discord.gg/DdwgBuReJe" + } + ] +} \ No newline at end of file diff --git a/static/footer.css b/static/footer.css index 947d815..a642ae3 100644 --- a/static/footer.css +++ b/static/footer.css @@ -1 +1 @@ -*,::backdrop,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.absolute{position:absolute}.bottom-0{bottom:0}.left-0{left:0}.right-0{right:0}.top-16{top:4rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-2{margin-bottom:.5rem;margin-top:.5rem}.my-4{margin-bottom:1rem;margin-top:1rem}.mb-28{margin-bottom:7rem}.mb-4{margin-bottom:1rem}.mt-12{margin-top:3rem}.block{display:block}.flex{display:flex}.h-5{height:1.25rem}.h-8{height:2rem}.w-12{width:3rem}.w-5{width:1.25rem}.max-w-sm{max-width:24rem}.grow{flex-grow:1}.translate-y-\[-8rem\]{--tw-translate-y:-8rem}.translate-y-\[-8rem\],.translate-y-\[-9rem\]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\[-9rem\]{--tw-translate-y:-9rem}.flex-col{flex-direction:column}.justify-center{justify-content:center}.border-2{border-width:2px}.border-solid{border-style:solid}.bg-\[\#0f1125\]{--tw-bg-opacity:1;background-color:rgb(15 17 37/var(--tw-bg-opacity))}.p-10{padding:2.5rem}.p-16{padding:4rem}.p-4{padding:1rem}.px-2{padding-left:.5rem;padding-right:.5rem}.py-3{padding-bottom:.75rem;padding-top:.75rem}.py-6{padding-bottom:1.5rem;padding-top:1.5rem}.pt-12{padding-top:3rem}.pt-20{padding-top:5rem}.text-center{text-align:center}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.text-slate-100{--tw-text-opacity:1;color:rgb(241 245 249/var(--tw-text-opacity))}.text-slate-400{--tw-text-opacity:1;color:rgb(148 163 184/var(--tw-text-opacity))}.hover\:underline:hover,.underline{text-decoration-line:underline}@media (min-width:640px){.sm\:flex-row{flex-direction:row}.sm\:justify-around{justify-content:space-around}.sm\:pt-0{padding-top:0}}@media (min-width:768px){.md\:px-4{padding-left:1rem;padding-right:1rem}.md\:text-2xl{font-size:1.5rem;line-height:2rem}} \ No newline at end of file +*,::backdrop,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.absolute{position:absolute}.relative{position:relative}.bottom-0{bottom:0}.left-0{left:0}.right-0{right:0}.top-16{top:4rem}.z-10{z-index:10}.m-auto{margin:auto}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-2{margin-bottom:.5rem;margin-top:.5rem}.my-4{margin-bottom:1rem;margin-top:1rem}.mb-28{margin-bottom:7rem}.mb-4{margin-bottom:1rem}.mt-12{margin-top:3rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.block{display:block}.flex{display:flex}.h-5{height:1.25rem}.h-8{height:2rem}.h-10{height:2.5rem}.h-24{height:6rem}.h-16{height:4rem}.h-20{height:5rem}.h-14{height:3.5rem}.w-12{width:3rem}.w-5{width:1.25rem}.w-10{width:2.5rem}.w-20{width:5rem}.w-24{width:6rem}.w-28{width:7rem}.max-w-sm{max-width:24rem}.grow{flex-grow:1}.translate-y-\[-9rem\]{--tw-translate-y:-9rem}.transform,.translate-y-\[-9rem\]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.justify-center{justify-content:center}.border-2{border-width:2px}.border-solid{border-style:solid}.bg-\[\#0f1125\]{--tw-bg-opacity:1;background-color:rgb(15 17 37/var(--tw-bg-opacity))}.bg-\[\#f0ece8\]{--tw-bg-opacity:1;background-color:rgb(240 236 232/var(--tw-bg-opacity))}.p-10{padding:2.5rem}.p-16{padding:4rem}.p-4{padding:1rem}.px-2{padding-left:.5rem;padding-right:.5rem}.py-3{padding-bottom:.75rem;padding-top:.75rem}.py-6{padding-bottom:1.5rem;padding-top:1.5rem}.py-4{padding-bottom:1rem;padding-top:1rem}.py-8{padding-bottom:2rem;padding-top:2rem}.px-4{padding-left:1rem;padding-right:1rem}.pt-12{padding-top:3rem}.pt-20{padding-top:5rem}.pb-10{padding-bottom:2.5rem}.text-center{text-align:center}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.font-bold{font-weight:700}.uppercase{text-transform:uppercase}.text-slate-100{--tw-text-opacity:1;color:rgb(241 245 249/var(--tw-text-opacity))}.text-slate-400{--tw-text-opacity:1;color:rgb(148 163 184/var(--tw-text-opacity))}.hover\:underline:hover,.underline{text-decoration-line:underline}@media (min-width:640px){.sm\:h-24{height:6rem}.sm\:h-20{height:5rem}.sm\:h-28{height:7rem}.sm\:h-14{height:3.5rem}.sm\:h-12{height:3rem}.sm\:flex-row{flex-direction:row}.sm\:justify-around{justify-content:space-around}.sm\:p-6{padding:1.5rem}.sm\:pt-0{padding-top:0}}@media (min-width:768px){.md\:h-24{height:6rem}.md\:px-4{padding-left:1rem;padding-right:1rem}.md\:text-2xl{font-size:1.5rem;line-height:2rem}} \ No newline at end of file diff --git a/templates/footer.html b/templates/footer.html index 59ce9aa..c35626e 100644 --- a/templates/footer.html +++ b/templates/footer.html @@ -20,30 +20,23 @@
Editors
- @Folyd - @LCrossman - @macko76 - @HandongZhang - @pau1tuck - @mfrw - @malagant + {% set authors = get_entity("authors") -%} + {% for author in authors|sort(attribute="id") -%} + {% if author.editor -%} + @{{ author.name }} + {% endif -%} + {% endfor -%}
+ {% set footer = load_json("footer.json") -%} + {% for column, items in footer | items -%}
-
Magazine
- All topics - All authors -
-
-
-
More
- About - FAQ - Open Collective - How to contribute - GitHub - Discord +
{{ column }}
+ {% for item in items -%} + {{ item.name }} + {% endfor -%}
+ {% endfor -%} From f011aa90a816797d524e7c4fdc703f5b059ebd68 Mon Sep 17 00:00:00 2001 From: Folyd Date: Wed, 5 Jul 2023 01:16:45 +0800 Subject: [PATCH 2/2] Add twitter account --- footer.json | 4 ++++ static/footer.css | 2 +- templates/footer.html | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/footer.json b/footer.json index 4e6a607..4c50ca5 100644 --- a/footer.json +++ b/footer.json @@ -30,6 +30,10 @@ "name": "GitHub", "url": "https://github.com/RustMagazine/rustmagazine" }, + { + "name": "Twitter", + "url": "https://twitter.com/rustmagazineorg" + }, { "name": "Discord", "url": "https://discord.gg/DdwgBuReJe" diff --git a/static/footer.css b/static/footer.css index a642ae3..b887de0 100644 --- a/static/footer.css +++ b/static/footer.css @@ -1 +1 @@ -*,::backdrop,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.absolute{position:absolute}.relative{position:relative}.bottom-0{bottom:0}.left-0{left:0}.right-0{right:0}.top-16{top:4rem}.z-10{z-index:10}.m-auto{margin:auto}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-2{margin-bottom:.5rem;margin-top:.5rem}.my-4{margin-bottom:1rem;margin-top:1rem}.mb-28{margin-bottom:7rem}.mb-4{margin-bottom:1rem}.mt-12{margin-top:3rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.block{display:block}.flex{display:flex}.h-5{height:1.25rem}.h-8{height:2rem}.h-10{height:2.5rem}.h-24{height:6rem}.h-16{height:4rem}.h-20{height:5rem}.h-14{height:3.5rem}.w-12{width:3rem}.w-5{width:1.25rem}.w-10{width:2.5rem}.w-20{width:5rem}.w-24{width:6rem}.w-28{width:7rem}.max-w-sm{max-width:24rem}.grow{flex-grow:1}.translate-y-\[-9rem\]{--tw-translate-y:-9rem}.transform,.translate-y-\[-9rem\]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.justify-center{justify-content:center}.border-2{border-width:2px}.border-solid{border-style:solid}.bg-\[\#0f1125\]{--tw-bg-opacity:1;background-color:rgb(15 17 37/var(--tw-bg-opacity))}.bg-\[\#f0ece8\]{--tw-bg-opacity:1;background-color:rgb(240 236 232/var(--tw-bg-opacity))}.p-10{padding:2.5rem}.p-16{padding:4rem}.p-4{padding:1rem}.px-2{padding-left:.5rem;padding-right:.5rem}.py-3{padding-bottom:.75rem;padding-top:.75rem}.py-6{padding-bottom:1.5rem;padding-top:1.5rem}.py-4{padding-bottom:1rem;padding-top:1rem}.py-8{padding-bottom:2rem;padding-top:2rem}.px-4{padding-left:1rem;padding-right:1rem}.pt-12{padding-top:3rem}.pt-20{padding-top:5rem}.pb-10{padding-bottom:2.5rem}.text-center{text-align:center}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.font-bold{font-weight:700}.uppercase{text-transform:uppercase}.text-slate-100{--tw-text-opacity:1;color:rgb(241 245 249/var(--tw-text-opacity))}.text-slate-400{--tw-text-opacity:1;color:rgb(148 163 184/var(--tw-text-opacity))}.hover\:underline:hover,.underline{text-decoration-line:underline}@media (min-width:640px){.sm\:h-24{height:6rem}.sm\:h-20{height:5rem}.sm\:h-28{height:7rem}.sm\:h-14{height:3.5rem}.sm\:h-12{height:3rem}.sm\:flex-row{flex-direction:row}.sm\:justify-around{justify-content:space-around}.sm\:p-6{padding:1.5rem}.sm\:pt-0{padding-top:0}}@media (min-width:768px){.md\:h-24{height:6rem}.md\:px-4{padding-left:1rem;padding-right:1rem}.md\:text-2xl{font-size:1.5rem;line-height:2rem}} \ No newline at end of file +*,::backdrop,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.absolute{position:absolute}.bottom-0{bottom:0}.left-0{left:0}.right-0{right:0}.top-16{top:4rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-2{margin-bottom:.5rem;margin-top:.5rem}.my-4{margin-bottom:1rem;margin-top:1rem}.mb-28{margin-bottom:7rem}.mb-4{margin-bottom:1rem}.mt-12{margin-top:3rem}.block{display:block}.flex{display:flex}.h-5{height:1.25rem}.h-8{height:2rem}.w-12{width:3rem}.w-5{width:1.25rem}.max-w-sm{max-width:24rem}.grow{flex-grow:1}.translate-y-\[-9rem\]{--tw-translate-y:-9rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.flex-col{flex-direction:column}.justify-center{justify-content:center}.border-2{border-width:2px}.border-solid{border-style:solid}.bg-\[\#0f1125\]{--tw-bg-opacity:1;background-color:rgb(15 17 37/var(--tw-bg-opacity))}.p-10{padding:2.5rem}.p-16{padding:4rem}.p-4{padding:1rem}.px-2{padding-left:.5rem;padding-right:.5rem}.py-20{padding-bottom:5rem;padding-top:5rem}.py-3{padding-bottom:.75rem;padding-top:.75rem}.py-6{padding-bottom:1.5rem;padding-top:1.5rem}.pt-12{padding-top:3rem}.text-center{text-align:center}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.capitalize{text-transform:capitalize}.text-slate-100{--tw-text-opacity:1;color:rgb(241 245 249/var(--tw-text-opacity))}.text-slate-400{--tw-text-opacity:1;color:rgb(148 163 184/var(--tw-text-opacity))}.hover\:underline:hover,.underline{text-decoration-line:underline}@media (min-width:640px){.sm\:flex-row{flex-direction:row}.sm\:justify-around{justify-content:space-around}.sm\:pt-0{padding-top:0}}@media (min-width:768px){.md\:px-4{padding-left:1rem;padding-right:1rem}.md\:text-2xl{font-size:1.5rem;line-height:2rem}} \ No newline at end of file diff --git a/templates/footer.html b/templates/footer.html index c35626e..36923e2 100644 --- a/templates/footer.html +++ b/templates/footer.html @@ -1,4 +1,4 @@ -
+
Subscriber: