Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartmaxwell committed Nov 15, 2024
1 parent c684c68 commit 0441962
Show file tree
Hide file tree
Showing 6 changed files with 117 additions and 9 deletions.
37 changes: 35 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ This package uses semantic versioning, but until we reach version 1.x.x, the fol
- MINOR version indicates that an incompatible or breaking change has been introduced.
- PATCH version indicates a bug fix or a backward compatible change.

If you choose to use this package prior to version 1.x being release, please pin your requirements to a specific minor version, e.g. `djpress==0.3.*`
If you choose to use this package prior to version 1.x being release, please pin your requirements to a specific minor version, e.g. `djpress~=0.11.0`

## Installation

- Install `djpress` by adding it to your requirements file, e.g. `djpress==0.3.*` (see versioning note, above).
- Install `djpress` by adding it to your requirements file, e.g. `djpress~=0.11.0` (see versioning note, above).
- Add it to your `INSTALLED_APPS` in Django:

```python
Expand All @@ -29,6 +29,8 @@ INSTALLED_APPS = [

- Add the URLs to your project's main `urls.py` file.

The following will set DJ Press to be available at the root of your site, e.g. `https://example.com/`

```python
from django.urls import path, include

Expand All @@ -39,10 +41,41 @@ urlpatterns = [
]
```

If you want your blog to be in a subdirectory, use something like the following:

```python
from django.urls import path, include

urlpatterns = [
# ...
path("blog/", include("djpress.urls")),
# ...
]
```

- Run migrations: `python3 manage.py migrate`

> Note that this relies on the Django Admin for content management, so ensure that you have a user with at least `staff` status to manage content.
## Configuration

In your settings.py file, create a `DJPRESS_SETTINGS` dictionary. Here are some common settings:

```python
# DJPress settings
DJPRESS_SETTINGS = {
"BLOG_TITLE": "My Awesome Blog",
"POST_PREFIX": "{{ year }}/{{ month }}",
}
```

There are lots more settings available. Please checks the docs or look at the source code:
[src/djpress/app_settings.py](https://github.com/stuartmaxwell/djpress/blob/main/src/djpress/app_settings.py)

## Documentation

Documentation is a work-in-progress but is available on GitHub Pages: <https://stuartmaxwell.github.io/djpress>

## Badges

[![codecov](https://codecov.io/github/stuartmaxwell/djpress/graph/badge.svg?token=IOS7BCD54B)](https://codecov.io/github/stuartmaxwell/djpress)
29 changes: 29 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Configuration

## DJ Press Settings

In your settings.py file, create a `DJPRESS_SETTINGS` dictionary. Here are some common settings:

```python
# DJPress settings
DJPRESS_SETTINGS = {
"BLOG_TITLE": "My Awesome Blog",
"POST_PREFIX": "{{ year }}/{{ month }}",
}
```

There are lots more settings available. Please checks the docs or look at the source code:
[src/djpress/app_settings.py](https://github.com/stuartmaxwell/djpress/blob/main/src/djpress/app_settings.py)

## Themes

There are two themes included with DJ Press: "default" and "simple". They can be configured as follows:

```python
# DJPress settings
DJPRESS_SETTINGS = {
"THEME": "simple",
}
```

To create, your own theme please read the [Theme documentation](themes.md)
4 changes: 4 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
Welcome to the documentation site for DJ Press. This is a work in progress, but the following key areas are mostly
complete:

- [Installation](installation.md)
- [Configuration](configuration.md)
- [URL Structure](url_structure.md)
- [Template Tags](templatetags.md)
- [Themes](themes.md)
Expand All @@ -13,6 +15,8 @@ complete:
---
maxdepth: 2
---
installation
configuration
url_structure
templatetags
themes
Expand Down
46 changes: 46 additions & 0 deletions docs/installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Installation

> Note: If you choose to use this package prior to version 1.x being release, please pin your requirements to a specific minor version, e.g. `djpress~=0.11.0`
- Install `djpress` by adding it to your requirements file, e.g. `djpress~=0.11.0` (see versioning note, above).
- Add it to your `INSTALLED_APPS` in Django:

```python
INSTALLED_APPS = [
# ...
"djpress.apps.DjpressConfig",
# ...
]
```

- Add the URLs to your project's main `urls.py` file.

The following will set DJ Press to be available at the root of your site, e.g. `https://example.com/`

```python
from django.urls import path, include

urlpatterns = [
# ...
path("", include("djpress.urls")),
# ...
]
```

If you want your blog to be in a subdirectory, e.g. `https://example.com/blog/`, use something like the following:

```python
from django.urls import path, include

urlpatterns = [
# ...
path("blog/", include("djpress.urls")),
# ...
]
```

- Run migrations: `python3 manage.py migrate`

> Note that DJ Press relies on the Django Admin for content management, so ensure that you have a user with at least `staff` status to manage content.
- Access your site's admin panel to manage content, e.g. `https://example.com/admin/djpress/`
8 changes: 2 additions & 6 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,6 @@ pc-up:
pc-run:
{{uv-tool}} pre-commit run --all-files

# Sphinx
sphinx:
@{{SPHINXBUILD}} -M "{{SOURCEDIR}}" "{{BUILDDIR}}" {{SPHINXOPTS}}

# Live HTML build with auto-reload
sphinx-live:
# Use Sphinx to build and view the documentation
docs:
uv run sphinx-autobuild -b html "{{SOURCEDIR}}" "{{BUILDDIR}}" {{SPHINXOPTS}}
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0441962

Please sign in to comment.