Add content

This commit is contained in:
Ategon 2024-02-26 03:25:11 -05:00
parent d5f0ff3f12
commit 4852cd92d1
238 changed files with 7833 additions and 0 deletions

5
archetypes/default.md Normal file
View File

@ -0,0 +1,5 @@
+++
title = '{{ replace .File.ContentBaseName "-" " " | title }}'
date = {{ .Date }}
draft = true
+++

103
assets/_custom.scss Normal file
View File

@ -0,0 +1,103 @@
.book-menu-content nav ul:nth-child(3) {
color: gray;
label a img {
color: gray;
filter: invert(0.4)
}
}
.book-search {
input {
transition: all;
transition-duration: 300ms;
width: 100%;
&:focus {
width: 102%;
color: gold;
}
}
}
.book-menu-content nav ul:nth-child(6) {
padding-top: 20px;
color: gray;
}
*:focus {
outline-style: none;
outline-color: transparent;
}
.book-menu {
strong {
color: gray;
}
a {
transition: all;
transition-duration: 300ms;
&:hover {
opacity: .8;
transform: scale(1.05);
@media (prefers-reduced-motion) {
transform: none;
}
}
&.active {
color: transparent;
background-clip: text;
background-color: rgb(44,175,208);
background-image: linear-gradient(90deg, rgba(44,175,208,1) 0%, rgba(148,45,253,1) 100%);
}
}
}
.book-brand {
span {
color: transparent;
background-clip: text;
background-color: rgb(44,175,208);
background-image: linear-gradient(90deg, rgba(44,175,208,1) -50%, rgba(148,45,253,1) 150%);
}
}
.book-page {
article p:nth-child(2){
color: gray;
}
a {
color: rgb(70, 100, 200);
}
h1 {
color: rgb(44, 175, 208);
}
h2 {
color: rgb(88, 85, 233);
}
h3 {
color: rgb(148, 45, 253);
}
}
.book-toc-content {
ul {
li a {
transition: all;
transition-duration: 300ms;
color: rgb(150, 150, 150);
}
ul li a {
transition: all;
transition-duration: 300ms;
color: rgb(100, 100, 100);
}
}
}

17
assets/_variables.scss Normal file
View File

@ -0,0 +1,17 @@
@mixin theme-dark {
--gray-100: rgba(255, 255, 255, 0.1);
--gray-200: rgba(255, 255, 255, 0.2);
--gray-500: rgba(255, 255, 255, 0.5);
--color-link: #84b2ff;
--color-visited-link: #b88dff;
--body-background: #121212;
--body-font-color: #d9dcdf;
--icon-filter: brightness(0) invert(1);
--hint-color-info: #6bf;
--hint-color-warning: #fd6;
--hint-color-danger: #f66;
}

View File

@ -0,0 +1,3 @@
---
BookMenuBundle: '/menu/test'
---

View File

@ -0,0 +1,59 @@
# Automation Guidelines
These are guidelines to follow when using any form of automation on an account hosted on Programming.Dev ("programming.dev", "we", "us", "our") sites or in communities hosted on the site from federated instances. When using automation within communities on other instances make sure to follow their specific guidelines in addition to these if they exist.
Failure to follow these guidelines may result in the account using the automation being banned from the instance.
> Guidelines marked with (C) can be overriden by community mods while ones marked with (A) can be overriden by a instance admin if they give permission to you.
## 1. General Guidelines
This are guidelines that aren't specific to one form of automation and should be followed regardless of the type of automation you are doing.
### 1.1. Use Mentions as a Prefix
If the automation includes the usage of commands such as help, contact, remindme, generate, etc. it should use the mention of the account as the prefix as opposed to something such as ! or ?. This allows multiple automations to use the same commands without interfering with each other and ensures people are using the one they intended to use.
### 1.2. No Trigger Overlap (C)
Do not make triggers fill the same niche as an already established one in the community you are posting in. For example if theres already a tldr bot posting tldrs for news posts there doesn't need to be a second one in the comments. (Can be overriden by the community mods)
### 1.3. No Vote Manupulation
Automation should not be used to affect the voting system in the instance. The vote it will automatically do on the accounts own posts are fine but it should not be used to automatically vote on other people's posts or comments.
## 2. Bots
These guidelines are specific to bot usage. This means accounts that exist solely to be automated to do things (tldr bot, remindme bot, reply bots, etc.) or that do specific things without any form of human intervention in the chain
> Examples of things in this category:
> - Automatically posting things from an rss feed
> - Automatically generating tldrs of articles posted to a community
> - Automatically posting a link to an alternate frontend for a site when theres a link to the site
### 2.1. Mark Bots as Bots
Bot accounts should be marked that they are a bot using the checkbox in the user settings
### 2.2. Put Contact Info
The owner of the bot and some way to contact them must be in the bots bio
### 2.3. Don't Spam (A)
Bots should not spam posts or comments. Automatically making posts or comments is fine but it should not drown out non automation content. When looking at the last 20 posts in a community, at least 75% should be human created (your specific bot should take less than the 25% for bots since other bots exist to share that with). There are some cases where having a community with mostly or only bot content makes sense (e.g. daily programming quotes, a challenge community that auto posts daily challenges from another site) and in that case you should reach out to an instance admin to get it approved (and you should be one of the mods for that community). When admin approved it still should not drown out human posts in the local feed in the instance.
### 2.4. Allow Mods to Opt In (A)
Before using a bot in a community allow the mod to opt in to the bots.
If a bot is deemed to be a well behaving bot that brings net good to the instance it can override this rule as long as it has been approved by an admin. If this happens mods should still be able to opt out of use of your bot.
## 3. Tools
These guidelines are for tool usage for semi-automated actions or things that don't affect other users.
> [!note]
> Examples of things in this category:
> - Scheduling posts
> - Monthly/Weekly repeated thread posts in a community
> - Auto marking posts with certain keywords as read for you (this one is more automated but only affects your own account)
### 3.1. Mark That You Use Automation
As some software doesn't have this built in currently you can just put the information in your bio. This could be something such as "Some actions in this account are automated", "Cyborg account", or "Uses some automation tools". You could also put what specific things you use if you want but it is not required. If the software supports marking an account as a cyborg you can use that instead.
## Do we Make Updates to these Automation Guidelines?
We may update the Automation Guidelines from time to time. When we do the date at the bottom of the page will change to indicate the date of the most recent changes. In addition, clicking on that date will bring you to the commit in the code repository that shows who edited it, and what was changed. If we make changes we may notify you by posting a notice of such changes in our meta community on the programming.dev site, in the updates account on the bytes.programming.dev site, in the news community in our discord server, and in the news community in our matrix server. We encourage you to review the Automation Guidelines periodically for any modifications.
## Contact Us
If you have questions or concerns about these Automation Guidelines you should contact us at info@programming.dev.

View File

@ -0,0 +1,52 @@
# Code of Conduct
This code of conduct details the expected conduct of users using Programming.Dev ("programming.dev", "we", "us", "our") sites whether in communities local to our sites or on communities federated with it that is visible from our site. It also applies to other spaces we exist such as our discord server and matrix server. Users visible on our sites regardless of whether they are local or federated may be actioned upon if they do not follow this code of conduct.
## Expected Behaviour
The following are expected behaviour for people interacting on our sites.
- **Remember the human:** When interacting with other people on the site they should be interacted with as if they are a human, that is with respect and in a way that you would want to be treated.
- **Keep in mind software differences:** As this is the fediverse, not everyone is interacting from the same software or the same type of software (people in microblogs may join in to the threaded posts, etc.). Due to this not everyone has access to the same features we do so features should not be assumed to be standard (e.g. visible pronouns, markdown, votes).
## Encouraged Behaviour
The following are encouraged behaviours for people interacting on our sites (that is not following it won't get you actioned upon but it is strongly recommended to follow).
- **Add Alt Text:** When posting an image add alt text to it in some form (if the software has it built in you can use that feature and if not you can provide it beside the image)
## Unacceptable Behaviour
The following are not allowed in any of our sites and may result in you being actioned upon by moderators or admins.
- **Doxing:** Do not reveal private information about other people without their explicit permission.
- **Ad Hominem:** When arguing with someone do not attack the person themselves, instead target the argument they are making.
- **Impersonation:** Do not impersonate other people regardless of whether they are in the community or not.
- **Unmarked Sensitive Content:** Do not post sensitive content (such as NSFW) without labelling it as such. If the software does not allow you to label it for people who don't want that content to be able to not see it, do not post the content.
- **Hate Speech:** Do not make remarks directed at sex, gender, ethnicity, orientation, disabilities, etc.
- **Vote Manipulation:** Attempts to manipulate the voting system is not tolerated including the usage of sock puppet accounts, target voting someone for who they are rather than their content, and mass downvoting posts.
- **Encouraging Harm:** Do not tell others to do things such as harm themselves or die.
- **Unwelcome Sexual Advances:** Do not sexually harass other people, regardless of whether they are in the community or the post is about them.
- **Illegal Content:** Do not post things that are illegal in the United States including: CSAM, Copyright Infringement, Lolicon.
- **Unrelated Content:** Do not post content that does not relate to a community in the community. For example if there is a community about posting cute pictures of puppies, do not post NSFW content.
- **Ban Evasion:** If you were banned from a community, do not attempt to evade said ban on another account.
- **Harassment:** Harassment whether in public spaces in the communities or in private messages is not tolerated.
## Community Specific Guidelines
Some communities within one of our sites may have additional or more specific guidelines in the community description that are expected to be followed when interacting in that community. Failure to follow those guidelines may result in you being actioned upon by moderators.
## Automation Guidelines
If you use any form of automation on your accounts you must abide by our [Automation Guidelines](https://legal.programming.dev/docs/automation-guidelines).
## Community Guidelines
If you manage a community on our sites you must abide by our [Community Guidelines](https://legal.programming.dev/docs/community-guidelines).
## Moderator Guidelines
If you are a moderator for our sites or for a community on our sites you must abide by our [Moderator Guidelines](https://legal.programming.dev/docs/moderator-guidelines).
## Admin Guidelines
If you are an admin for our sites you must abide by our [Admin Guidelines](https://legal.programming.dev/docs/admin-guidelines).
## Reporting
When you see someone not behaving according to our code of conduct, if theres a report button built into the software (which should be most software we host) you can report them for the community team in charge of that software to be able to deal with it. If theres no report button email info@programming.dev with the report information.
## Do we Make Updates to this Code of Conduct?
We may update the Code of Conduct from time to time. When we do the date at the bottom of the page will change to indicate the date of the most recent changes. In addition, clicking on that date will bring you to the commit in the code repository that shows who edited it, and what was changed. If we make changes we may notify you by posting a notice of such changes or by sending you a notification. We encourage you to review the Code of Conduct periodically for any modifications.
## Contact Us
If you have questions or concerns about this Code of Conduct you should contact us at info@programming.dev.

View File

@ -0,0 +1,12 @@
# Community Guidelines
These Community Guidelines detail expected conduct and suggested actions when managing a community on Programming.Dev ("programming.dev", "we", "us", "our") sites.
## 1. Community Info
## 2.
## Do we Make Updates to these Community Guidelines?
We may update the Community Guidelines from time to time. When we do the date at the bottom of the page will change to indicate the date of the most recent changes. In addition, clicking on that date will bring you to the commit in the code repository that shows who edited it, and what was changed. If we make changes we may notify you by posting a notice of such changes in our meta community on the programming.dev site, in the updates account on the bytes.programming.dev site, in the news community in our discord server, and in the news community in our matrix server. We encourage you to review the Community Guidelines periodically for any modifications.
## Contact Us
If you have questions or concerns about these Community Guidelines you should contact us at info@programming.dev.

View File

View File

@ -0,0 +1,7 @@
# Cookie Policy
## Do we Make Updates to this Cookie Policy?
We may update the Cookie Policy from time to time. When we do, we will change the "Last Updated" date and author at the top of the page to indicate the date and author of the most recent changes. If we make changes we may notify you by posting a notice of such changes or by sending you a notification. We encourage you to review the Cookie Policy periodically for any modifications.
## Contact Us
If you have questions or concerns about this Cookie Policy you should contact us at info@programming.dev.

View File

View File

@ -0,0 +1,45 @@
# 🌍 Defederation Policy
This document details how Programming.Dev ("programming.dev", "we", "us", "our") choose to defederate with other instances. If an instance wishes to be federated and thus have their content show on our sites they must abide by the policy and ensure they do not do one of the actions in the how an instance gets defederated section.
## What is Defederation?
Our sites are federated with other instances. Instances are essentially sites but that are instances of federated software. This means that content posted on our sites is visible from other sites and we get content from other sites to interact with on our sites. Someone in a federated forum about cars may browse programming posts on their cars site and comment from there and we may do the same to them.
Defederating from a instance:
- Makes users from our sites not be able to see things such as posts and comments from users on that instance.
- Makes users from that instance no longer be able to interact with communities or users on our sites in a way thats visible outside of their instance.
## How does an instance get defederated?
- Instances may be defederated if they break our [Code of Conduct](https://legal.programming.dev/docs/code-of-conduct) whether though encouraging something we disallow or not moderating users that break it.
- Instances that have no active administrators may be defederated.
- Instances that have a lack of security that is not addressed and that puts our users at risk may be defederated. This includes things like having a sign up process that does not stop bots from mass creating accounts.
- Instances that have defederated from us may be defederated to prevent one way conversations where we get content from the other instance but users commenting on that content get no response.
## Defederated Instances
This is a list of all of the instances we have currently defederated and the reasoning for them:
Forums & Link Aggregators
```
burggit.moe - Lolicon, Shotacon, & Ignoring DMCA requests
hexbear.net - Not on allowlist
kbin.cafe - CSAM
mujico.org - Racism
rqd2.net - Pedophilia, Zoophilia, & Biastophilia
```
Microblogs
```
13bells.com - Hate Speech, Homophobia & Transphobia
1611.social - Hate Speech, Homophobia & Racism
4aem.com - Antisemitism
5dollah.click - Racism
more to be added here. Full list is visible on fediseer or our site federation tab if it exists
```
## Defederation Appeals
If you are the admin of an instance we have defederated, you wish to reverse the defederation, and you follow our [Code of Conduct](https://legal.programming.dev/docs/code-of-conduct) contact us as info@programming.dev.
## Are Updates Made to this Defederation Policy?
We may update the Defederation Policy from time to time. When we do the date at the bottom of the page will change to indicate the date of the most recent changes. In addition, clicking on that date will bring you to the commit in the code repository that shows who edited it, and what was changed. If we make changes we may notify you by posting a notice of such changes in our meta community on the programming.dev site, in the updates account on the bytes.programming.dev site, in our blog on the stacks.programming.dev site, in the news community in our discord server, and in the news community in our matrix server. We encourage you to review the Defederation Policy periodically for any modifications.
## Contact Us
If you have questions or concerns about this Defederation Policy you should contact us at info@programming.dev.

View File

@ -0,0 +1,31 @@
# ❤️ Donation Policy
This is a policy that describes how Programming.Dev ("programming.dev", "we", "us", "our") handles and spends donations made towards us.
## How are Donations Made?
Donations are currently made using [snowe's github sponsors page](https://github.com/sponsors/snowe2010/). If you get another place to donate that is not this it is fake and should be reported to us.
## How are Donations Spent?
Donations are spent on things relating to our sites. This includes things such as server costs, infrastructure costs, tool costs, and payment for work done relating to it.
## Who is Considered a Donator?
Donators are people who have at one point made a donation towards us regardless on whether they are currently doing a monthly donation, did one in the past, or did a one time donation.
## Donation Perks
We offer perks towards donators that have at one point made a donation towards us. These are the current perks donators get:
- A donator role on our discord server.
- An account on our linkstack site https://me.programming.dev for sharing links related to you in a page.
## Donation Perk Terms
By donating to programming.dev you acknowledge and agree to the following terms:
- **Display Proof:** To get access to a perk you must be able to prove that you are the one that made the donation.
- **Account Requirement:** Access to a perk requires an account on the platform the perk is on. For example to get a discord role you need a discord account.
- **Request Perks:** To get a perk you need to request it from a community team admin in charge of the software the perk is on or from our contact email at info@programming.dev.
- **Refund Policy:** Donations are generally non refundable. If a perk is removed or edited refunds will not be given.
- **Modification of Perks:** Perks may be modified at any time to change details about a perk, add new perks, or remove existing perks. They are privileges and do not constitute a legal right or entitlement.
- **Perk Removal:** Users may have perks taken away from them if they abuse the perk (as in use it in a way it was not intended) or break our [Code of Conduct](https://github.com/programming-dot-dev/p.d-legal/blob/main/CODE-OF-CONDUCT.md).
## Are Updates Made to this Donation Policy?
We may update the Donation Policy from time to time. When we do the date at the bottom of the page will change to indicate the date of the most recent changes. In addition, clicking on that date will bring you to the commit in the code repository that shows who edited it, and what was changed. If we make changes we may notify you by posting a notice of such changes in our meta community on the programming.dev site, in the updates account on the bytes.programming.dev site, in our blog on the stacks.programming.dev site, in the news community in our discord server, and in the news community in our matrix server. We encourage you to review the Donation Policy periodically for any modifications.
## Contact Us
If you have questions or concerns about this Donation Policy you should contact us at info@programming.dev.

View File

@ -0,0 +1,8 @@
# Moderator Guidelines
These moderator guidelines detail expected conduct when moderating a community in one of the Programming.Dev ("programming.dev", "we", "us", "our") sites.
## Do we Make Updates to these Moderator Guidelines?
We may update the Moderator Guidelines from time to time. When we do the date at the bottom of the page will change to indicate the date of the most recent changes. In addition, clicking on that date will bring you to the commit in the code repository that shows who edited it, and what was changed. If we make changes we may notify you by posting a notice of such changes in our meta community on the programming.dev site, in the updates account on the bytes.programming.dev site, in the news community in our discord server, and in the news community in our matrix server. We encourage you to review the Moderator Guidelines periodically for any modifications.
## Contact Us
If you have questions or concerns about these Moderator Guidelines you should contact us at info@programming.dev.

View File

@ -0,0 +1,71 @@
# Privacy Policy
This privacy policy describes how Programming.Dev ("programming.dev", "we", "us", "our") collects, protects and uses information provided to us when you use our services including:
- Our websites such as programming.dev or bytes.programming.dev.
- APIs for our websites.
- Any other place we collect information from you and link this Privacy Policy.
By joining and contributing to our services, you acknowledge that it is running on early release software. Although we take reasonable precautions to maintain the security of personal data provided to us we cannot guarantee that the software is free from defect that will expose any or all of that personal data.
If you do not agree with all of our policies and practices, do not use our services. If you have any questions or concerns, contact us at info@programming.dev.
## Site Usage by Children:
All of our services are directed towards people who are at least 16 years old. We do not knowingly collect personal information from people under the age of 16. If you are under the age of 16, please do not use our services. If we learn that personal information from people who are less than 16 years old has been collected, we will deactivate the account and take reasonable measures to delete the data from our records.
## What do we use Your Information for?
Any information we collect from you may be used in the following ways:
- To provide the core functionality of our services such as being able to comment on other people's posts or subscribing to communities when you are logged in.
- To aid in moderation of our services, for example to detect vote manipulation.
- To send you information, notifications about other people interacting with your content or sending you messages, or notifications for new posts created, if you opt in to any of these options in the settings. We may also use it to respond to you about inquiries, and/or other requests or questions.
## What Information do we Collect?
**Account/Profile Information:**
- When creating an account on one of our services you may be asked to enter in a username and password. You may also enter additional information into optional fields such as: email, display name, profile picture, banner image, matrix ID, location, birthday, language, and biography.
- Currently (as of February 10, 2024), all of the optional fields are always listed publicly; your password and email is kept private.
**Service Provided User Actions:**
- On any of our services, when performing an action the date and time (during when the action is taken) is recorded in addition to saving the content and any media attachments (pictures and/or videos) alongside the performed action. All of this information is publicly available due to the nature of federation which uses the [ActivityPub protocol](https://en.wikipedia.org/wiki/ActivityPub). The actions made by users of our services is sent to other instances using the ActivityPub protocol and then stored on their servers so that they can display the actions correctly on their instances.
- Actions in the context of our provided services and Privacy Policy may include (not exhaustive):
1. Creating/editing a post or comment.
2. Voting/reacting on a post or comment.
3. Subscribing to a community or magazine.
**Direct Messages:**
- All direct messages sent are unencrypted and may be delivered to other servers if the user you are sending a message to is on a service other than one provided by us. We make a good faith effort to limit the access to direct messages to only authorized persons but other servers may fail to do so, so it is important to review who and what service you are sending messages to. Please keep in mind that operators of our services and any receiving services may view direct messages and that recipients may screenshot, copy, or otherwise re-share them so it is recommended to not share any sensitive information.
**IPs and Other Metadata:**
- When you log in, we may record the IP address you logged in from, the time and date you logged in at, as well as the name of your browser application. We also have server logs which include the IP address of every request to our server.
- Image embedded metadata [(Exif data)](https://en.wikipedia.org/wiki/Exif), on images hosted on our services are scrubbed/erased.
- Your IP address and email remains private to our services. However, due to the nature of federated services, all of your engagement (profile, posts, comments, messages, votes, etc.) on our services should be considered public and you are responsible for taking appropriate precautions in how you interact with our services. It is highly recommended that you do not share any publicly identifying information on our sites, products, or services.
## How do we Protect Your Information?
We implement a variety of security measures to maintain the safety of your personal information when you enter, submit, or access your personal information. Among other things, your browser session, as well as the traffic between your applications and the API, are secured with SSL, and your password is hashed using a strong one-way algorithm. You may also enable two factor authentication to further protect your account.
## What is our Data Retention Policy?
We will make a good faith effort to:
- Retain server logs containing the IP address of all requests to this server, in so far as such logs are kept, no more than 1 day.
- Retain the IP addresses and name of your browser application associated with logins for no more than 1 day.
You may irreversibly delete your account at any time. However, this does not guarantee all instances will be notified or respect the deletion of your public data.
## Do we use Cookies?
We use cookies for specific functionalities, which includes Cloudflare clearance and JWT (JSON Web Token) authentication purposes.
- Cloudflare clearance: Cookies provided by Cloudflare to store the proof of passing a Cloudflare challenge.
- JWT: A token to allow you to access and interact with our services after logging in.
These cookies do not store personally identifiable information and are necessary for the proper functioning of our services. By continuing to use our services, you consent to the use of these essential cookies.
Please note that you can manage or disable cookies through your browser settings. However, disabling these essential cookies may impact the functionality and security of services.
## Do we Disclose Any Information to Outside Parties?
We do not sell, trade, or transfer your personal information to outside parties. This does not include trusted third parties who assist us in operating our services, so long as those parties agree to keep this information confidential.
Your public content may be downloaded by other servers using the [ActivityPub protocol](https://en.wikipedia.org/wiki/ActivityPub), as well as direct messages to the servers of the recipients.
When you log in to your account on a service not provided by us, it may access your public information as well as password when logging in.
## Do we Make Updates to This Privacy Policy?
We may update this privacy policy from time to time. When we do, we will change the "Last Updated" date and author at the top of the page to indicate the date and author of the most recent changes. If we make changes we may notify you by posting a notice of such changes or by sending you a notification. We encourage you to review this Privacy Policy periodically for any modifications.
## Contact Us
If you have questions or concerns about this Privacy Policy you should contact us at info@programming.dev.

View File

@ -0,0 +1,7 @@
# Terms of Service
## Do we Make Updates to this Terms of Service?
We may update the Terms of Service from time to time. When we do, we will change the "Last Updated" date and author at the top of the page to indicate the date and author of the most recent changes. If we make changes we may notify you by posting a notice of such changes or by sending you a notification. We encourage you to review the Terms of Service periodically for any modifications.
## Contact Us
If you have questions or concerns about this Terms of Service you should contact us at info@programming.dev.

View File

@ -0,0 +1,7 @@
---
BookMenuBundle: '/menu/test'
---
Test 2A
ASFASF
ASFAISHFIUASF

19
content/menu/_index.md Normal file
View File

@ -0,0 +1,19 @@
---
headless: true
---
**Documents**
- [🛠️ Admin Guidelines]({{< relref "/docs/admin-guidelines" >}})
- [🤖 Automation Guidelines]({{< relref "/docs/automation-guidelines" >}})
- [🤝 Code of Conduct]({{< relref "/docs/code-of-conduct" >}})
- [🪴 Community Guidelines]({{< relref "/docs/community-guidelines" >}})
- [🪲 Contributing Guidelines]({{< relref "/docs/contributing-guidelines" >}})
- [🍪 Cookie Policy]({{< relref "/docs/cookie-policy" >}})
- [📘 Data Retention Policy]({{< relref "/docs/data-retention-policy" >}})
- [🌍 Defederation Policy]({{< relref "/docs/defederation-policy" >}})
- [❤️ Donation Policy]({{< relref "/docs/donation-policy" >}})
- [🏡 Moderator Guidelines]({{< relref "/docs/moderator-guidelines" >}})
- [🔒 Privacy Policy]({{< relref "/docs/privacy-policy" >}})
- [📜 Terms of Service]({{< relref "/docs/terms-of-service" >}})
- [A]({{< relref "/docs/test/test" >}})
<br/>

View File

@ -0,0 +1,14 @@
---
headless: true
---
**Documents**
- [🛠️ Admin Guidelines]({{< relref "/docs/privacy-policy" >}})
- [🤖 Automation Guidelines]({{< relref "/docs/automation-guidelines" >}})
- [🤝 Code of Conduct]({{< relref "/docs/code-of-conduct" >}})
- [🪴 Community Guidelines]({{< relref "/docs/community-guidelines" >}})
- [🪲 Contributing Guidelines]({{< relref "/docs/contributing-guidelines" >}})
- [🍪 Cookie Policy]({{< relref "/docs/cookie-policy" >}})
- [📘 Data Retention Policy]({{< relref "/docs/data-retention-policy" >}})
- [A]({{< relref "/docs/test/test" >}})
<br/>

29
hugo.yaml Normal file
View File

@ -0,0 +1,29 @@
baseURL: https://example.com/
title: P.D Legal
theme: hugo-book
enableGitInfo: true
languages:
en:
languageName: English
contentDir: content
weight: 1
menu:
# before: []
after:
- name: "Source"
url: "https://github.com/programming-dot-dev/p.d-legal"
weight: 10
- name: "Links"
url: "https://me.programming.dev"
weight: 100
params:
BookTheme: 'auto'
BookToC: true
BookLogo: 'logo.png'
BookFavicon: 'logo.png'
BookMenuBundle: /menu
BookRepo: https://github.com/programming-dot-dev/p.d-legal

View File

@ -0,0 +1,4 @@
{{ with .Site.GetPage .Page.Params.BookMenuBundle }}
{{- $href := printf "href=\"%s\"" $.RelPermalink -}}
{{- replace .Content $href (print $href "class=active") | safeHTML -}}
{{ end }}

View File

@ -0,0 +1,25 @@
<nav>
{{ partial "docs/brand" . }}
{{ partial "docs/search" . }}
{{ partial "docs/languages" . }}
{{ partial "docs/inject/menu-before" . }}
{{ partial "docs/menu-hugo" .Site.Menus.before }}
{{ if .Page.Params.BookMenuBundle }}
{{ partial "docs/menu-page-bundle" . }}
{{ else if .Site.Params.BookMenuBundle }}
{{ partial "docs/menu-bundle" . }}
{{ else }}
{{ partial "docs/menu-filetree" . }}
{{ end }}
{{ partial "docs/menu-hugo" .Site.Menus.after }}
{{ partial "docs/inject/menu-after" . }}
</nav>
<!-- Restore menu position as soon as possible to avoid flickering -->
{{ $script := resources.Get "menu-reset.js" | resources.Minify }}
{{ with $script.Content }}
<script>{{ . | safeJS }}</script>
{{ end }}

BIN
static/logo.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

View File

@ -0,0 +1,34 @@
name: Build with Hugo
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
hugo-version:
- 'latest'
- '0.79.0'
steps:
- uses: actions/checkout@v4
with:
submodules: true # Fetch Hugo themes (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: ${{ matrix.hugo-version }}
extended: true
- name: Run Hugo
working-directory: exampleSite
run: hugo --themesDir ../..
# - name: Deploy
# uses: peaceiris/actions-gh-pages@v3
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: ./public

4
themes/hugo-book/.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
public/
exampleSite/public/
.DS_Store
.hugo_build.lock

20
themes/hugo-book/LICENSE Normal file
View File

@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2018 Alex Shpak
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

358
themes/hugo-book/README.md Normal file
View File

@ -0,0 +1,358 @@
# Hugo Book Theme
[![Hugo](https://img.shields.io/badge/hugo-0.79-blue.svg)](https://gohugo.io)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
![Build with Hugo](https://github.com/alex-shpak/hugo-book/workflows/Build%20with%20Hugo/badge.svg)
### [Hugo](https://gohugo.io) documentation theme as simple as plain book
![Screenshot](https://github.com/alex-shpak/hugo-book/blob/master/images/screenshot.png)
- [Features](#features)
- [Requirements](#requirements)
- [Installation](#installation)
- [Menu](#menu)
- [Blog](#blog)
- [Configuration](#configuration)
- [Shortcodes](#shortcodes)
- [Versioning](#versioning)
- [Contributing](#contributing)
## Features
- Clean simple design
- Light and Mobile-Friendly
- Multi-language support
- Customisable
- Zero initial configuration
- Handy shortcodes
- Comments support
- Simple blog and taxonomy
- Primary features work without JavaScript
- Dark Mode
## Requirements
- Hugo 0.79 or higher
- Hugo extended version, read more [here](https://gohugo.io/news/0.48-relnotes/)
## Installation
### Install as git submodule
Navigate to your hugo project root and run:
```
git submodule add https://github.com/alex-shpak/hugo-book themes/hugo-book
```
Then run hugo (or set `theme = "hugo-book"`/`theme: hugo-book` in configuration file)
```
hugo server --minify --theme hugo-book
```
### Install as hugo module
You can also add this theme as a Hugo module instead of a git submodule.
Start with initializing hugo modules, if not done yet:
```
hugo mod init github.com/repo/path
```
Navigate to your hugo project root and add [module] section to your `config.toml`:
```toml
[module]
[[module.imports]]
path = 'github.com/alex-shpak/hugo-book'
```
Then, to load/update the theme module and run hugo:
```sh
hugo mod get -u
hugo server --minify
```
### Creating site from scratch
Below is an example on how to create a new site from scratch:
```sh
hugo new site mydocs; cd mydocs
git init
git submodule add https://github.com/alex-shpak/hugo-book themes/hugo-book
cp -R themes/hugo-book/exampleSite/content.en/* ./content
```
```sh
hugo server --minify --theme hugo-book
```
## Menu
### File tree menu (default)
By default, the theme will render pages from the `content/docs` section as a menu in a tree structure.
You can set `title` and `weight` in the front matter of pages to adjust the order and titles in the menu.
### Leaf bundle menu (Deprecated, to be removed in June 2022)
You can also use leaf bundle and the content of its `index.md` file as menu.
Given you have the following file structure:
```
├── content
│ ├── docs
│ │ ├── page-one.md
│ │ └── page-two.md
│ └── posts
│ ├── post-one.md
│ └── post-two.md
```
Create a file `content/menu/index.md` with the content:
```md
+++
headless = true
+++
- [Book Example]({{< relref "/docs/" >}})
- [Page One]({{< relref "/docs/page-one" >}})
- [Page Two]({{< relref "/docs/page-two" >}})
- [Blog]({{< relref "/posts" >}})
```
And Enable it by setting `BookMenuBundle: /menu` in Site configuration.
- [Example menu](https://github.com/alex-shpak/hugo-book/blob/master/exampleSite/content.en/menu/index.md)
- [Example config file](https://github.com/alex-shpak/hugo-book/blob/master/exampleSite/config.yaml)
- [Leaf bundles](https://gohugo.io/content-management/page-bundles/)
## Blog
A simple blog is supported in the section `posts`.
A blog is not the primary usecase of this theme, so it has only minimal features.
## Configuration
### Site Configuration
There are a few configuration options that you can add to your `config.toml` file.
You can also see the `yaml` example [here](https://github.com/alex-shpak/hugo-book/blob/master/exampleSite/config.yaml).
```toml
# (Optional) Set Google Analytics if you use it to track your website.
# Always put it on the top of the configuration file, otherwise it won't work
googleAnalytics = "UA-XXXXXXXXX-X"
# (Optional) If you provide a Disqus shortname, comments will be enabled on
# all pages.
disqusShortname = "my-site"
# (Optional) Set this to true if you use capital letters in file names
disablePathToLower = true
# (Optional) Set this to true to enable 'Last Modified by' date and git author
# information on 'doc' type pages.
enableGitInfo = true
# (Optional) Theme is intended for documentation use, therefore it doesn't render taxonomy.
# You can remove related files with config below
disableKinds = ['taxonomy', 'taxonomyTerm']
[params]
# (Optional, default light) Sets color theme: light, dark or auto.
# Theme 'auto' switches between dark and light modes based on browser/os preferences
BookTheme = 'light'
# (Optional, default true) Controls table of contents visibility on right side of pages.
# Start and end levels can be controlled with markup.tableOfContents setting.
# You can also specify this parameter per page in front matter.
BookToC = true
# (Optional, default none) Set the path to a logo for the book. If the logo is
# /static/logo.png then the path would be 'logo.png'
BookLogo = 'logo.png'
# (Optional, default none) Set leaf bundle to render as side menu
# When not specified file structure and weights will be used
# Deprecated, to be removed in June 2022
BookMenuBundle = '/menu'
# (Optional, default docs) Specify section of content to render as menu
# You can also set value to "*" to render all sections to menu
BookSection = 'docs'
# Set source repository location.
# Used for 'Last Modified' and 'Edit this page' links.
BookRepo = 'https://github.com/alex-shpak/hugo-book'
# Specifies commit portion of the link to the page's last modified commit hash for 'doc' page
# type.
# Required if 'BookRepo' param is set.
# Value used to construct a URL consisting of BookRepo/BookCommitPath/<commit-hash>
# Github uses 'commit', Bitbucket uses 'commits'
BookCommitPath = 'commit'
# Enable 'Edit this page' links for 'doc' page type.
# Disabled by default. Uncomment to enable. Requires 'BookRepo' param.
# Path must point to the site directory.
BookEditPath = 'edit/master/exampleSite'
# (Optional, default January 2, 2006) Configure the date format used on the pages
# - In git information
# - In blog posts
BookDateFormat = 'Jan 2, 2006'
# (Optional, default true) Enables search function with flexsearch,
# Index is built on fly, therefore it might slowdown your website.
# Configuration for indexing can be adjusted in i18n folder per language.
BookSearch = true
# (Optional, default true) Enables comments template on pages
# By default partials/docs/comments.html includes Disqus template
# See https://gohugo.io/content-management/comments/#configure-disqus
# Can be overwritten by same param in page frontmatter
BookComments = true
# /!\ This is an experimental feature, might be removed or changed at any time
# (Optional, experimental, default false) Enables portable links and link checks in markdown pages.
# Portable links meant to work with text editors and let you write markdown without {{< relref >}} shortcode
# Theme will print warning if page referenced in markdown does not exists.
BookPortableLinks = true
# /!\ This is an experimental feature, might be removed or changed at any time
# (Optional, experimental, default false) Enables service worker that caches visited pages and resources for offline use.
BookServiceWorker = true
```
### Multi-Language Support
Theme supports Hugo's [multilingual mode](https://gohugo.io/content-management/multilingual/), just follow configuration guide there. You can also tweak search indexing configuration per language in `i18n` folder.
### Page Configuration
You can specify additional params in the front matter of individual pages:
```toml
# Set type to 'docs' if you want to render page outside of configured section or if you render section other than 'docs'
type = 'docs'
# Set page weight to re-arrange items in file-tree menu (if BookMenuBundle not set)
weight = 10
# (Optional) Set to 'true' to mark page as flat section in file-tree menu (if BookMenuBundle not set)
bookFlatSection = false
# (Optional) Set to hide nested sections or pages at that level. Works only with file-tree menu mode
bookCollapseSection = true
# (Optional) Set true to hide page or section from side menu (if BookMenuBundle not set)
bookHidden = false
# (Optional) Set 'false' to hide ToC from page
bookToC = true
# (Optional) If you have enabled BookComments for the site, you can disable it for specific pages.
bookComments = true
# (Optional) Set to 'false' to exclude page from search index.
bookSearchExclude = true
# (Optional) Set explicit href attribute for this page in a menu (if BookMenuBundle not set)
bookHref = ''
```
### Partials
There are layout partials available for you to easily override components of the theme in `layouts/partials/`.
In addition to this, there are several empty partials you can override to easily add/inject code.
| Empty Partial | Placement |
| -------------------------------------------------- | ------------------------------------------- |
| `layouts/partials/docs/inject/head.html` | Before closing `<head>` tag |
| `layouts/partials/docs/inject/body.html` | Before closing `<body>` tag |
| `layouts/partials/docs/inject/footer.html` | After page footer content |
| `layouts/partials/docs/inject/menu-before.html` | At the beginning of `<nav>` menu block |
| `layouts/partials/docs/inject/menu-after.html` | At the end of `<nav>` menu block |
| `layouts/partials/docs/inject/content-before.html` | Before page content |
| `layouts/partials/docs/inject/content-after.html` | After page content |
| `layouts/partials/docs/inject/toc-before.html` | At the beginning of table of contents block |
| `layouts/partials/docs/inject/toc-after.html` | At the end of table of contents block |
### Extra Customisation
| File | Description |
| ------------------------ | ------------------------------------------------------------------------------------- |
| `static/favicon.png` | Override default favicon |
| `assets/_custom.scss` | Customise or override scss styles |
| `assets/_variables.scss` | Override default SCSS variables |
| `assets/_fonts.scss` | Replace default font with custom fonts (e.g. local files or remote like google fonts) |
| `assets/mermaid.json` | Replace Mermaid initialization config |
### Plugins
There are a few features implemented as pluggable `scss` styles. Usually these are features that don't make it to the core but can still be useful.
| Plugin | Description |
| --------------------------------- | ----------------------------------------------------------- |
| `assets/plugins/_numbered.scss` | Makes headings in markdown numbered, e.g. `1.1`, `1.2` |
| `assets/plugins/_scrollbars.scss` | Overrides scrollbar styles to look similar across platforms |
To enable plugins, add `@import "plugins/{name}";` to `assets/_custom.scss` in your website root.
### Hugo Internal Templates
There are a few hugo templates inserted in `<head>`
- [Google Analytics](https://gohugo.io/templates/internal/#google-analytics)
- [Open Graph](https://gohugo.io/templates/internal/#open-graph)
To disable Open Graph inclusion you can create your own empty file `\layouts\_internal\opengraph.html`.
In fact almost empty not quite empty because an empty file looks like absent for HUGO. For example:
```
<!-- -->
```
## Shortcodes
- [Buttons](https://hugo-book-demo.netlify.app/docs/shortcodes/buttons/)
- [Columns](https://hugo-book-demo.netlify.app/docs/shortcodes/columns/)
- [Details](https://hugo-book-demo.netlify.app/docs/shortcodes/details/)
- [Hints](https://hugo-book-demo.netlify.app/docs/shortcodes/hints/)
- [KaTeX](https://hugo-book-demo.netlify.app/docs/shortcodes/katex/)
- [Mermaid](https://hugo-book-demo.netlify.app/docs/shortcodes/mermaid/)
- [Tabs](https://hugo-book-demo.netlify.app/docs/shortcodes/tabs/)
By default, Goldmark trims unsafe outputs which might prevent some shortcodes from rendering. It is recommended to set `markup.goldmark.renderer.unsafe=true` if you encounter problems.
```toml
[markup.goldmark.renderer]
unsafe = true
```
If you are using `config.yaml` or `config.json`, consult the [configuration markup](https://gohugo.io/getting-started/configuration-markup/)
## Versioning
This theme follows a simple incremental versioning. e.g. `v1`, `v2` and so on. There might be breaking changes between versions.
If you want lower maintenance, use one of the released versions. If you want to live on the bleeding edge of changes, you can use the `master` branch and update your website when needed.
## Contributing
### [Extra credits to contributors](https://github.com/alex-shpak/hugo-book/graphs/contributors)
Contributions are welcome and I will review and consider pull requests.
Primary goals are:
- Keep it simple.
- Keep minimal (or zero) default configuration.
- Avoid interference with user-defined layouts.
- Avoid using JS if it can be solved by CSS.
Feel free to open issues if you find missing configuration or customisation options.

View File

@ -0,0 +1,10 @@
---
title: "{{ .Name | humanize | title }}"
weight: 1
# bookFlatSection: false
# bookToc: true
# bookHidden: false
# bookCollapseSection: false
# bookComments: false
# bookSearchExclude: false
---

View File

@ -0,0 +1,6 @@
---
title: "{{ .Name | humanize | title }}"
date: {{ .Date }}
# bookComments: false
# bookSearchExclude: false
---

View File

@ -0,0 +1,3 @@
/* You can add custom styles here. */
// @import "plugins/numbered";

View File

@ -0,0 +1,66 @@
// Used in layout
$padding-1: 1px !default;
$padding-4: 0.25rem !default;
$padding-8: 0.5rem !default;
$padding-16: 1rem !default;
$font-size-base: 16px !default;
$font-size-12: 0.75rem !default;
$font-size-14: 0.875rem !default;
$font-size-16: 1rem !default;
$border-radius: $padding-4 !default;
$body-font-weight: normal !default;
$body-min-width: 20rem !default;
$container-max-width: 80rem !default;
$header-height: 3.5rem !default;
$menu-width: 16rem !default;
$toc-width: 16rem !default;
$mobile-breakpoint: $menu-width + $body-min-width * 1.2 + $toc-width !default;
$hint-colors: (
info: #6bf,
warning: #fd6,
danger: #f66,
) !default;
// Themes
@mixin theme-light {
--gray-100: #f8f9fa;
--gray-200: #e9ecef;
--gray-500: #adb5bd;
--color-link: #0055bb;
--color-visited-link: #8440f1;
--body-background: white;
--body-font-color: black;
--icon-filter: none;
--hint-color-info: #6bf;
--hint-color-warning: #fd6;
--hint-color-danger: #f66;
}
@mixin theme-dark {
--gray-100: rgba(255, 255, 255, 0.1);
--gray-200: rgba(255, 255, 255, 0.2);
--gray-500: rgba(255, 255, 255, 0.5);
--color-link: #84b2ff;
--color-visited-link: #b88dff;
--body-background: #343a40;
--body-font-color: #e9ecef;
--icon-filter: brightness(0) invert(1);
--hint-color-info: #6bf;
--hint-color-warning: #fd6;
--hint-color-danger: #f66;
}

View File

@ -0,0 +1,39 @@
/* roboto-regular - latin */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
font-display: swap;
src: local(''),
url('fonts/roboto-v27-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('fonts/roboto-v27-latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* roboto-700 - latin */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 700;
font-display: swap;
src: local(''),
url('fonts/roboto-v27-latin-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('fonts/roboto-v27-latin-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* roboto-mono-regular - latin */
@font-face {
font-family: 'Roboto Mono';
font-style: normal;
font-weight: 400;
font-display: swap;
src: local(''),
url('fonts/roboto-mono-v13-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('fonts/roboto-mono-v13-latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
body {
font-family: 'Roboto', sans-serif;
}
code {
font-family: 'Roboto Mono', monospace;
}

View File

@ -0,0 +1,364 @@
html {
font-size: $font-size-base;
scroll-behavior: smooth;
touch-action: manipulation;
}
body {
min-width: $body-min-width;
color: var(--body-font-color);
background: var(--body-background);
letter-spacing: 0.33px;
font-weight: $body-font-weight;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
box-sizing: border-box;
* {
box-sizing: inherit;
}
}
h1,
h2,
h3,
h4,
h5 {
font-weight: $body-font-weight;
}
a {
text-decoration: none;
color: var(--color-link);
}
img {
vertical-align: baseline;
}
:focus {
@include outline;
}
aside nav ul {
padding: 0;
margin: 0;
list-style: none;
li {
margin: 1em 0;
position: relative;
}
a {
display: block;
}
a:hover {
opacity: 0.5;
}
ul {
padding-inline-start: $padding-16;
}
}
ul.pagination {
display: flex;
justify-content: center;
list-style-type: none;
padding-inline-start: 0px;
.page-item a {
padding: $padding-16;
}
}
.container {
max-width: $container-max-width;
margin: 0 auto;
}
.book-icon {
filter: var(--icon-filter);
}
.book-brand {
margin-top: 0;
margin-bottom: $padding-16;
img {
height: 1.5em;
width: 1.5em;
margin-inline-end: $padding-8;
}
}
.book-menu {
flex: 0 0 $menu-width;
font-size: $font-size-14;
.book-menu-content {
width: $menu-width;
padding: $padding-16;
background: var(--body-background);
@include fixed;
}
a,
label {
color: inherit;
cursor: pointer;
word-wrap: break-word;
}
a.active {
color: var(--color-link);
}
input.toggle + label + ul {
display: none;
}
input.toggle:checked + label + ul {
display: block;
}
input.toggle + label::after {
content: "";
}
input.toggle:checked + label::after {
content: "";
}
}
// for RTL support
body[dir="rtl"] .book-menu {
input.toggle + label::after {
content: "";
}
input.toggle:checked + label::after {
content: "";
}
}
.book-section-flat {
margin: $padding-16 * 2 0;
> a,
> span,
> label {
font-weight: bolder;
}
> ul {
padding-inline-start: 0;
}
}
.book-page {
min-width: $body-min-width;
flex-grow: 1;
padding: $padding-16;
}
.book-post {
margin-bottom: $padding-16 * 3;
}
.book-header {
display: none;
margin-bottom: $padding-16;
label {
line-height: 0;
}
img.book-icon {
height: 1.5em;
width: 1.5em;
}
}
.book-search {
position: relative;
margin: $padding-16 0;
border-bottom: 1px solid transparent;
input {
width: 100%;
padding: $padding-8;
border: 0;
border-radius: $border-radius;
background: var(--gray-100);
color: var(--body-font-color);
&:required + .book-search-spinner {
display: block;
}
}
.book-search-spinner {
position: absolute;
top: 0;
margin: $padding-8;
margin-inline-start: calc(100% - #{$padding-16 + $padding-8});
width: $padding-16;
height: $padding-16;
border: $padding-1 solid transparent;
border-top-color: var(--body-font-color);
border-radius: 50%;
@include spin(1s);
}
small {
opacity: 0.5;
}
}
.book-toc {
flex: 0 0 $toc-width;
font-size: $font-size-12;
.book-toc-content {
width: $toc-width;
padding: $padding-16;
@include fixed;
}
img {
height: 1em;
width: 1em;
}
nav > ul > li:first-child {
margin-top: 0;
}
}
.book-footer {
padding-top: $padding-16;
font-size: $font-size-14;
img {
height: 1em;
width: 1em;
margin-inline-end: $padding-8;
}
}
.book-comments {
margin-top: $padding-16;
}
.book-languages {
margin-block-end: $padding-16 * 2;
.book-icon {
height: 1em;
width: 1em;
margin-inline-end: .5em;
}
ul {
padding-inline-start: 1.5em;
}
}
// Responsive styles
.book-menu-content,
.book-toc-content,
.book-page,
.book-header aside,
.markdown {
transition: 0.2s ease-in-out;
transition-property: transform, margin, opacity, visibility;
will-change: transform, margin, opacity;
}
@media screen and (max-width: $mobile-breakpoint) {
#menu-control,
#toc-control {
display: inline;
}
.book-menu {
visibility: hidden;
margin-inline-start: -$menu-width;
font-size: $font-size-base;
z-index: 1;
}
.book-toc {
display: none;
}
.book-header {
display: block;
}
#menu-control:focus ~ main label[for="menu-control"] {
@include outline;
}
#menu-control:checked ~ main {
.book-menu {
visibility: initial;
}
.book-menu .book-menu-content {
transform: translateX($menu-width);
box-shadow: 0 0 $padding-8 rgba(0, 0, 0, 0.1);
}
.book-page {
opacity: 0.25;
}
.book-menu-overlay {
display: block;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
}
#toc-control:focus ~ main label[for="toc-control"] {
@include outline;
}
#toc-control:checked ~ main {
.book-header aside {
display: block;
}
}
// for RTL support
body[dir="rtl"] #menu-control:checked ~ main {
.book-menu .book-menu-content {
transform: translateX(-$menu-width);
}
}
}
// Extra space for big screens
@media screen and (min-width: $container-max-width) {
.book-page,
.book-menu .book-menu-content,
.book-toc .book-toc-content {
padding: $padding-16 * 2 $padding-16;
}
}

View File

@ -0,0 +1,197 @@
@import "variables";
.markdown {
line-height: 1.6;
// remove padding at the beginning of page
> :first-child {
margin-top: 0;
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-weight: normal;
line-height: 1;
margin-top: 1.5em;
margin-bottom: $padding-16;
a.anchor {
opacity: 0;
font-size: 0.75em;
vertical-align: middle;
text-decoration: none;
}
&:hover a.anchor,
a.anchor:focus {
opacity: initial;
}
}
h4,
h5,
h6 {
font-weight: bolder;
}
h5 {
font-size: 0.875em;
}
h6 {
font-size: 0.75em;
}
b,
optgroup,
strong {
font-weight: bolder;
}
a {
text-decoration: none;
&:hover {
text-decoration: underline;
}
&:visited {
color: var(--color-visited-link);
}
}
img {
max-width: 100%;
height: auto;
}
code {
padding: 0 $padding-4;
background: var(--gray-200);
border-radius: $border-radius;
font-size: 0.875em;
}
pre {
padding: $padding-16;