mirror of
https://github.com/privacyguides/privacyguides.org.git
synced 2025-07-02 17:42:39 +00:00
Transition to mkdocs (#829)
Co-authored-by: Jonah Aragon <jonah@triplebit.net>
This commit is contained in:
25
theme/overrides/blog.css
Normal file
25
theme/overrides/blog.css
Normal file
@ -0,0 +1,25 @@
|
||||
/* Blog hero section */
|
||||
.mdx-container {
|
||||
background-color: white;
|
||||
padding-top: 1rem;
|
||||
}
|
||||
|
||||
.mdx-hero {
|
||||
color: var(--md-primary-bg-color);
|
||||
margin: 0 0.8rem;
|
||||
text-align: center;
|
||||
}
|
||||
.mdx-hero h1 {
|
||||
color: currentcolor;
|
||||
font-weight: 700;
|
||||
margin-bottom: 1rem;
|
||||
font-size: 2rem;
|
||||
}
|
||||
@media screen and (max-width: 29.9375em) {
|
||||
.mdx-hero h1 {
|
||||
font-size: 1.4rem;
|
||||
}
|
||||
}
|
||||
.mdx-hero__content {
|
||||
padding-top: 1rem;
|
||||
}
|
71
theme/overrides/blog.html
Normal file
71
theme/overrides/blog.html
Normal file
@ -0,0 +1,71 @@
|
||||
{% extends "base.html" %}
|
||||
{% block extrahead %}
|
||||
<link rel="stylesheet" href="{{ 'overrides/blog.css' | url }}">
|
||||
{% endblock %}
|
||||
{% block hero %}
|
||||
{{ super() }}
|
||||
<style>.md-content > .md-typeset h1{visibility:hidden;font-size:0;}</style>
|
||||
<section class="mdx-container" {% if page.meta.background %}style="background-image:linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.9)), url(/assets/img/blog/{{ page.meta.background }});padding-top:8rem;padding-bottom:4rem;background-size:cover;background-position:center;"{% endif %}>
|
||||
<div class="md-grid md-typeset">
|
||||
<div class="mdx-hero">
|
||||
<div class="mdx-hero__content" style>
|
||||
<h1 {% if page.meta.background %}style="color:white"{% endif %}>{{ page.meta.title }}</h1>
|
||||
{% if page.meta.excerpt %}<p {% if page.meta.background %}style="color:white"{% endif %}>{{ page.meta.excerpt }}</p>{% endif %}
|
||||
<nav class="md-tags">
|
||||
<span {% if page.meta.background %}style="color:white"{% endif %} class="md-tag">Author: {{ page.meta.author }}</span>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
{{ super() }}
|
||||
|
||||
<!-- Giscus -->
|
||||
<h2 id="__comments">{{ lang.t("meta.comments") }}</h2>
|
||||
<script src="https://giscus.app/client.js"
|
||||
data-repo="privacyguides/privacyguides.org"
|
||||
data-repo-id="MDEwOlJlcG9zaXRvcnkzMTg0MDE5MDY="
|
||||
data-category="Blog"
|
||||
data-category-id="DIC_kwDOEvptcs4COX5p"
|
||||
data-mapping="title"
|
||||
data-reactions-enabled="1"
|
||||
data-emit-metadata="0"
|
||||
data-input-position="top"
|
||||
data-theme="light"
|
||||
data-lang="en"
|
||||
crossorigin="anonymous"
|
||||
async>
|
||||
</script>
|
||||
|
||||
<!-- Reload on palette change -->
|
||||
<script>
|
||||
var palette = __md_get("__palette")
|
||||
if (palette && typeof palette.color === "object")
|
||||
if (palette.color.scheme === "slate") {
|
||||
var giscus = document.querySelector("script[src*=giscus]")
|
||||
giscus.setAttribute("data-theme", "dark")
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* Register event handlers after documented loaded */
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
var ref = document.querySelector("[data-md-component=palette]")
|
||||
ref.addEventListener("change", function() {
|
||||
var palette = __md_get("__palette")
|
||||
if (palette && typeof palette.color === "object") {
|
||||
var theme = palette.color.scheme === "slate" ? "dark" : "light"
|
||||
|
||||
/* Instruct Giscus to change theme */
|
||||
var frame = document.querySelector(".giscus-frame")
|
||||
frame.contentWindow.postMessage(
|
||||
{ giscus: { setConfig: { theme } } },
|
||||
"https://giscus.app"
|
||||
)
|
||||
}
|
||||
})
|
||||
})
|
||||
</script>
|
||||
{% endblock %}
|
62
theme/overrides/home.css
Normal file
62
theme/overrides/home.css
Normal file
@ -0,0 +1,62 @@
|
||||
/* Homepage hero section */
|
||||
.mdx-container {
|
||||
background: url("data:image/svg+xml;utf8,<svg width='100%' height='100%' viewBox='0 0 1123 258' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' xmlns:serif='http://www.serif.com/' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'><g transform='matrix(-1.01432,0,0,0.388868,1134.41,161.501)'><path d='M1124,2L1124,258L-1,258L-1,210C-1,210 15,215 54,215C170,215 251,123 379,123C500,123 493,169 633,169C773,169 847,2 1205,3L1124,2Z' style='fill:white;fill-rule:nonzero;'/></g></svg>")
|
||||
no-repeat bottom,
|
||||
linear-gradient(to bottom, var(--md-primary-fg-color), var(--md-primary-fg-color--light) 99%, var(--md-default-bg-color) 99%);
|
||||
padding-top: 1rem;
|
||||
}
|
||||
[data-md-color-scheme="slate"] .mdx-container {
|
||||
background: url("data:image/svg+xml;utf8,<svg width='100%' height='100%' viewBox='0 0 1123 258' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' xmlns:serif='http://www.serif.com/' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'><g transform='matrix(-1.01432,0,0,0.388868,1134.41,161.501)'><path d='M1124,2L1124,258L-1,258L-1,210C-1,210 15,215 54,215C170,215 251,123 379,123C500,123 493,169 633,169C773,169 847,2 1205,3L1124,2Z' style='fill:rgb(46,48,62);fill-rule:nonzero;'/></g></svg>")
|
||||
no-repeat bottom,
|
||||
linear-gradient(to bottom, var(--md-primary-fg-color), var(--md-primary-fg-color--dark) 99%, var(--md-default-bg-color) 99%);
|
||||
}
|
||||
|
||||
.mdx-hero {
|
||||
color: var(--md-primary-bg-color);
|
||||
margin: 0 0.8rem;
|
||||
}
|
||||
.mdx-hero h1 {
|
||||
color: currentcolor;
|
||||
font-weight: 700;
|
||||
margin-bottom: 1rem;
|
||||
font-size: 2.6rem;
|
||||
}
|
||||
@media screen and (max-width: 29.9375em) {
|
||||
.mdx-hero h1 {
|
||||
font-size: 1.4rem;
|
||||
}
|
||||
}
|
||||
.mdx-hero__content {
|
||||
padding-bottom: 6rem;
|
||||
}
|
||||
@media screen and (min-width: 60em) {
|
||||
.mdx-hero {
|
||||
align-items: stretch;
|
||||
display: flex;
|
||||
}
|
||||
.mdx-hero__content {
|
||||
margin-top: 3.5rem;
|
||||
max-width: 38rem;
|
||||
padding-bottom: 14vw;
|
||||
}
|
||||
.mdx-hero__image {
|
||||
order: 1;
|
||||
transform: translateX(4rem);
|
||||
width: 38rem;
|
||||
}
|
||||
}
|
||||
@media screen and (min-width: 76.25em) {
|
||||
.mdx-hero__image {
|
||||
transform: translateX(8rem);
|
||||
}
|
||||
}
|
||||
.mdx-hero .md-button {
|
||||
color: var(--md-primary-bg-color);
|
||||
}
|
||||
.mdx-hero .md-button--primary {
|
||||
color: var(--md-primary-fg-color)!important;
|
||||
background-color: var(--md-primary-bg-color);
|
||||
border-color: var(--md-primary-bg-color);
|
||||
margin-right: 0.5rem;
|
||||
margin-top: 0.5rem;
|
||||
}
|
24
theme/overrides/home.html
Normal file
24
theme/overrides/home.html
Normal file
@ -0,0 +1,24 @@
|
||||
{% extends "base.html" %}
|
||||
{% block extrahead %}
|
||||
<link rel="stylesheet" href="{{ 'overrides/home.css' | url }}">
|
||||
{% endblock %}
|
||||
{% block hero %}
|
||||
{{ super() }}
|
||||
<style>.md-content > .md-typeset h1{visibility:hidden;font-size:0;}</style>
|
||||
<section class="mdx-container">
|
||||
<div class="md-grid md-typeset">
|
||||
<div class="mdx-hero">
|
||||
<div class="mdx-hero__content">
|
||||
<h1>The guide to restoring your online privacy.</h1>
|
||||
<p>{{ config.site_description }}</p>
|
||||
<a href="{{ 'tools/' | url }}" title="Recommended services, tools, and knowledge to protect your privacy" class="md-button md-button--primary">
|
||||
Privacy Tools
|
||||
</a>
|
||||
<a href="{{ 'blog/' | url }}" title="Blog posts from Privacy Guides contributors" class="md-button">
|
||||
Read our blog
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
Reference in New Issue
Block a user