mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy.org.git
synced 2025-01-15 05:16:37 +00:00
fix: readme
This commit is contained in:
parent
a8a46f0395
commit
335646f5ba
122
README.md
122
README.md
|
@ -1,57 +1,82 @@
|
|||
# Docsy Example
|
||||
This is a repository for the SelfPrivacy website, available at https://selfprivacy.org/
|
||||
|
||||
[Docsy][] is a [Hugo theme module][] for technical documentation sites, providing easy
|
||||
site navigation, structure, and more. This **Docsy Example Project** uses the Docsy
|
||||
theme component as a hugo module and provides a skeleton documentation structure for you to use.
|
||||
You can clone/copy this project and edit it with your own content, or use it as an example.
|
||||
This website is statically generated using [Hugo][] and uses a customised version of the [Docsy][] theme. It is available in English and Russian.
|
||||
|
||||
In this project, the Docsy theme component is pulled in as a Hugo module, together with other module dependencies:
|
||||
## Getting started
|
||||
1. Clone this repo with `git clone https://git.selfprivacy.org/SelfPrivacy/selfprivacy.org.git`
|
||||
1. Run `hugo server`
|
||||
1. Open `http://localhost:1313/` in your browser
|
||||
|
||||
```bash
|
||||
$ hugo mod graph
|
||||
hugo: collected modules in 566 ms
|
||||
hugo: collected modules in 578 ms
|
||||
github.com/google/docsy-example github.com/google/docsy@v0.5.1-0.20221017155306-99eacb09ffb0
|
||||
github.com/google/docsy-example github.com/google/docsy/dependencies@v0.5.1-0.20221014161617-be5da07ecff1
|
||||
github.com/google/docsy/dependencies@v0.5.1-0.20221014161617-be5da07ecff1 github.com/twbs/bootstrap@v4.6.2+incompatible
|
||||
github.com/google/docsy/dependencies@v0.5.1-0.20221014161617-be5da07ecff1 github.com/FortAwesome/Font-Awesome@v0.0.0-20220831210243-d3a7818c253f
|
||||
If it doesn't work, check if you have [Hugo][] and dependencies installed.
|
||||
|
||||
If `1313` is already used for something else, Hugo will use a different port. Check your console to find out which one.
|
||||
|
||||
## Folder structure
|
||||
|
||||
```
|
||||
content/ source files in .md and .html
|
||||
assets/ assets that require preprocessing
|
||||
Dockerfile
|
||||
i18n/ UI translation strings
|
||||
layouts/ copied customised theme files
|
||||
LICENSE
|
||||
node_modules/
|
||||
public/ generated .html files
|
||||
resources/ generated assets
|
||||
static/ static assets
|
||||
_vendor/ customisable theme files
|
||||
package.json
|
||||
package-lock.json
|
||||
README.md <- you're here
|
||||
go.mod
|
||||
go.sum
|
||||
config.toml website settings
|
||||
netlify.toml
|
||||
docker-compose.yaml
|
||||
```
|
||||
|
||||
You can find detailed theme instructions in the [Docsy user guide][].
|
||||
In the `content/` folder, there are two folders, one per each language. Language folders have similar contents:
|
||||
|
||||
This Docsy Example Project is hosted on [Netlify][] at [example.docsy.dev][].
|
||||
You can view deploy logs from the [deploy section of the project's Netlify
|
||||
dashboard][deploys], or this [alternate dashboard][].
|
||||
```
|
||||
blog/ blog and releases
|
||||
docs/ documentation
|
||||
download/ download page
|
||||
privacy-policy/ privacy policy
|
||||
_index.html the landing page
|
||||
search.md
|
||||
|
||||
This is not an officially supported Google product. This project is currently maintained.
|
||||
|
||||
## Using the Docsy Example Project as a template
|
||||
|
||||
A simple way to get started is to use this project as a template, which gives you a site project that is set up and ready to use. To do this:
|
||||
|
||||
1. Click **Use this template**.
|
||||
|
||||
2. Select a name for your new project and click **Create repository from template**.
|
||||
|
||||
3. Make your own local working copy of your new repo using git clone, replacing https://github.com/me/example.git with your repo’s web URL:
|
||||
|
||||
```bash
|
||||
git clone --depth 1 https://github.com/me/example.git
|
||||
...other landing page files
|
||||
```
|
||||
|
||||
You can now edit your own versions of the site’s source files.
|
||||
### To add a new section or subsection
|
||||
1. Create a new folder
|
||||
1. Create a file called `_index.md` in that folder.
|
||||
1. Add more files if needed; put images and videos in the same folder
|
||||
|
||||
If you want to do SCSS edits and want to publish these, you need to install `PostCSS`
|
||||
### To add an image to the docs article
|
||||
To add an image to an article, create a new folder and put the article and it's illustrations in that folder.
|
||||
|
||||
```bash
|
||||
npm install
|
||||
In the text use `imgproc` shortcode with explicit width and height:
|
||||
```
|
||||
{{< imgproc filename Fill "1001x808" />}}
|
||||
```
|
||||
|
||||
### To change layout
|
||||
Go to the `_vendor/github.com/google/docsy/layouts` and change files there. Do not copy files to the project's `layouts/` folder, it was used before the theme was vendored and will be removed later.
|
||||
|
||||
### To change styles
|
||||
Change the `assets/scss/_styles_project.scss`. Use variables defined in the `_variables_project.scss`.
|
||||
|
||||
If you want to change the style of the Docsy theme components, navigate to `_vendor/github.com/google/docsy/assets/scss` and change files there instead.
|
||||
|
||||
### To reorder documentation pages
|
||||
In all of markdown files, change the `weight` number in the metadata.
|
||||
|
||||
|
||||
## Running the website locally
|
||||
|
||||
Building and running the site locally requires a recent `extended` version of [Hugo](https://gohugo.io).
|
||||
You can find out more about how to install Hugo for your environment in our
|
||||
[Getting started](https://www.docsy.dev/docs/getting-started/#prerequisites-and-installation) guide.
|
||||
You can find out more about how to install Hugo for your environment in the [Docsy Getting started guide](https://www.docsy.dev/docs/getting-started/#prerequisites-and-installation).
|
||||
|
||||
Once you've made your working copy of the site repo, from the repo root folder, run:
|
||||
|
||||
|
@ -114,8 +139,7 @@ Built in 288 ms
|
|||
Error: Error building site: TOCSS: failed to transform "scss/main.scss" (text/x-scss): resource "scss/scss/main.scss_9fadf33d895a46083cdd64396b57ef68" not found in file cache
|
||||
```
|
||||
|
||||
This error occurs if you have not installed the extended version of Hugo.
|
||||
See this [section](https://www.docsy.dev/docs/get-started/docsy-as-module/installation-prerequisites/#install-hugo) of the user guide for instructions on how to install Hugo.
|
||||
This error occurs if you have not [installed the extended version of Hugo](https://www.docsy.dev/docs/get-started/docsy-as-module/installation-prerequisites/#install-hugo).
|
||||
|
||||
Or you may encounter the following error:
|
||||
|
||||
|
@ -125,14 +149,18 @@ Or you may encounter the following error:
|
|||
Error: failed to download modules: binary with name "go" not found
|
||||
```
|
||||
|
||||
This error occurs if you have not installed the `go` programming language on your system.
|
||||
See this [section](https://www.docsy.dev/docs/get-started/docsy-as-module/installation-prerequisites/#install-go-language) of the user guide for instructions on how to install `go`.
|
||||
This error occurs if you have not [installed the `go` programming language on your system](https://www.docsy.dev/docs/get-started/docsy-as-module/installation-prerequisites/#install-go-language).
|
||||
|
||||
## Useful links
|
||||
|
||||
[alternate dashboard]: https://app.netlify.com/sites/goldydocs/deploys
|
||||
[deploys]: https://app.netlify.com/sites/docsy-example/deploys
|
||||
- [Hugo](https://gohugo.io/documentation/)
|
||||
- [Docsy](https://www.docsy.dev/docs/)
|
||||
- [CommonMark](https://spec.commonmark.org/0.31.2/)
|
||||
- [Sass](https://sass-lang.com/documentation/)
|
||||
- [Bootstrap](https://getbootstrap.com/docs/5.3/getting-started/introduction/)
|
||||
- [Spell Checker extension](https://open-vsx.org/extension/streetsidesoftware/code-spell-checker-russian)
|
||||
|
||||
[Hugo]: https://gohugo.io/documentation/
|
||||
[Hugo theme module]: https://gohugo.io/hugo-modules/use-modules/#use-a-module-for-a-theme
|
||||
[Docsy user guide]: https://docsy.dev/docs
|
||||
[Docsy]: https://github.com/google/docsy
|
||||
[example.docsy.dev]: https://example.docsy.dev
|
||||
[Hugo theme module]: https://gohugo.io/hugo-modules/use-modules/#use-a-module-for-a-theme
|
||||
[Netlify]: https://netlify.com
|
||||
|
|
Loading…
Reference in a new issue