Skip to content

Commit

Permalink
Merge pull request #78 from nastena1606/netlify-config-13
Browse files Browse the repository at this point in the history
Deploying docs on Netlify
  • Loading branch information
nastena1606 authored May 4, 2021
2 parents 4c85634 + 7fd2041 commit 1877eac
Show file tree
Hide file tree
Showing 9 changed files with 153 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@
build/
source/ext/psdom.pyc
source/ext/__pycache__/
source/percona-theme/
source/percona-theme/
source/__pycache__/
# Local Netlify folder
.netlify
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ html:
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."

netlify:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) -c source/conf-netlify $(BUILDDIR)/html
@echo
@echo "Netlify build finished. The HTML pages are in $(BUILDDIR)/html."

thtml:
@echo "Building themed html doc"
$(SPHINXBUILD) -D html_theme=alabaster -D html_theme_path='' -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
Expand Down
50 changes: 50 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
alabaster==0.7.12
Babel==2.8.0
beautifulsoup4==4.9.3
certifi==2020.6.20
chardet==3.0.4
click==7.1.2
css-html-js-minify==2.5.5
Deprecated==1.2.10
docutils==0.16
Flask==1.1.2
gitdb==4.0.5
GitPython==3.1.13
idna==2.10
imagesize==1.2.0
inflection==0.5.1
itsdangerous==1.1.0
Jinja2==2.11.2
livereload==2.6.3
lxml==4.6.2
MarkupSafe==1.1.1
packaging==20.4
py-buzz==2.0.0
Pygments==2.6.1
pyparsing==2.4.7
python-slugify==4.0.1
pytz==2020.1
requests==2.24.0
six==1.15.0
smmap==3.0.5
snowballstemmer==2.0.0
soupsieve==2.1
Sphinx==3.2.1
sphinx-autobuild==2020.9.1
sphinx-copybutton==0.3.1
sphinx-gitstamp==0.3.1
sphinx-material==0.0.32
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-contentui==0.2.5
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-fulltoc==1.2.0
sphinxcontrib-htmlhelp==1.0.3
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.4
text-unidecode==1.3
tornado==6.1
Unidecode==1.1.2
urllib3==1.25.10
Werkzeug==1.0.1
wrapt==1.12.1
1 change: 1 addition & 0 deletions runtime.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.7
12 changes: 12 additions & 0 deletions source/_static/images/percona-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/_static/images/percona_favicon.ico
Binary file not shown.
49 changes: 49 additions & 0 deletions source/_templates/layout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{# Import the theme's layout. #}
{% extends '!layout.html' %}

{ # Customize font # }
{% block font %}
<style>
body,
input {
font-family: "Chivo", "Helvetica Neue", Helvetica, Arial, sans-serif
}

</style>
{{ super() }}
{% endblock %}

{ # Add Fontawesome # }
{%- block fonticon %}
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet">
{{ super() }}
{%- endblock %}

{ # Adds the "Last updated label" at the bottom of the page # }
{%- block relbar2 %}
{%- if gitstamp %}
<div class="md_container">
<p><i class="fas fa-sync-alt"></i>
Last updated on {{ gitstamp }}. </p>
</div>
{%- endif %}
{{ super() }}
{%- endblock%}

{# 'Edit this page' links #}
{% block rootrellink %}
{{ super() }}
{% if repo_url|e %}
<div class="small">
<ul class="list-inline">
<li class="pull-right">
<a href="{{ repo_url }}/{{ edit_uri }}/{{ pagename }}.rst" target="_blank">
<i class="fa fa-github"></i>
Edit this page
</a>
</li>
</ul>
</div>
{% endif %}
{% endblock %}
31 changes: 31 additions & 0 deletions source/conf-netlify/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import os
sys.path.append(os.path.abspath("../"))
from conf import *
extensions.append('sphinx_gitstamp')
extensions.append('sphinx_copybutton')
html_theme = 'sphinx_material'
html_theme_options = {
'base_url': 'http://bashtage.github.io/sphinx-material/',
'repo_url': 'https://github.com/percona/postgresql-docs',
'repo_name': 'percona/postgresql-docs',
'color_accent': 'grey',
'color_primary': 'orange',
'globaltoc_collapse': True,
'version_dropdown': True,
'version_dropdown_text': 'Versions',
'version_info': {
"11": "https://postgresql-docs-11.netlify.app",
"12": "https://postgresql-docs-12.netlify.app",
"13": "https://postgresql-docs-11.netlify.app",
"Latest": "https://www.percona.com/doc/postgresql/LATEST/index.html"
},
}
html_logo = '../_static/images/percona-logo.svg'
html_favicon = '../_static/images/percona_favicon.ico'
pygments_style = 'emacs'
gitstamp_fmt = '%b %d, %Y'
copybutton_prompt_text = '$'
#html_last_updated_fmt = ''
2 changes: 1 addition & 1 deletion source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@

# Custom sidebar templates, maps document names to template names.
html_sidebars = {
'**': ['localtoc.html', 'relations.html', 'sourcelink.html', 'edit.html'],
'**': ['localtoc.html', 'relations.html', 'sourcelink.html', 'edit.html', 'searchbox.html', 'globaltoc.html'],
'using/windows': ['windowssidebar.html'],
}

Expand Down

0 comments on commit 1877eac

Please sign in to comment.