-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Intialize the index with: - current index - script to build the index - github action to weekly check for new optech topics - updated README
- Loading branch information
Showing
6 changed files
with
2,596 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Update Topics Index (Weekly) | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 * * 0' # Runs at 00:00 UTC every Sunday | ||
workflow_dispatch: # Allows manual triggering | ||
push: | ||
branches: | ||
- 'test/*' # Runs on any branch under test/ | ||
|
||
# Add explicit permissions for the GITHUB_TOKEN | ||
permissions: | ||
contents: write # Allows pushing to the repository | ||
|
||
jobs: | ||
update-topics: | ||
runs-on: ubuntu-latest | ||
|
||
# Add environment variables to control behavior | ||
env: | ||
IS_TEST: ${{ startsWith(github.ref, 'refs/heads/test/') }} | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
|
||
- name: Install dependencies | ||
run: pip install -r scripts/requirements.txt | ||
|
||
- name: Build Index | ||
run: python scripts/build_index.py | ||
|
||
- name: Check for changes | ||
id: changes | ||
run: | | ||
git diff --quiet || echo "changes=true" >> $GITHUB_OUTPUT | ||
- name: Configure Git | ||
if: steps.changes.outputs.changes == 'true' | ||
run: | | ||
git config user.name "GitHub Actions Bot" | ||
git config user.email "[email protected]" | ||
# Add debug information in test mode | ||
- name: Debug Info (Test Mode) | ||
if: env.IS_TEST == 'true' | ||
run: | | ||
echo "Changes detected: ${{ steps.changes.outputs.changes }}" | ||
git diff --stat | ||
git status | ||
- name: Commit and push if there are changes | ||
if: steps.changes.outputs.changes == 'true' | ||
run: | | ||
git add topics.json TOPICS.md | ||
# Add [TEST] prefix to commit message on test branches | ||
if [[ "${{ env.IS_TEST }}" == "true" ]]; then | ||
git commit -m "[TEST] Auto-update topics index" | ||
else | ||
git commit -m "Auto-update topics index" | ||
fi | ||
git push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,60 @@ | ||
# topics-index | ||
A list of Bitcoin topics | ||
# Bitcoin Topics Index | ||
|
||
An extensive index of Bitcoin-related topics, combining and enhancing the established [Bitcoin Optech Topics](https://bitcoinops.org/en/topics/) with additional relevant entries. | ||
|
||
See [TOPICS.md](TOPICS.md) for the categorized index or [topics.json](topics.json) for the machine-readable format. | ||
|
||
## Repository Structure | ||
|
||
``` | ||
. | ||
├── topics/ # Bitcoin topics | ||
│ ├── topic1.yaml | ||
│ ├── topic2.yaml | ||
│ └── ... | ||
├── scripts/ # Build and maintenance scripts | ||
│ └── build_index.py | ||
├── topics.json # Machine-readable index | ||
├── TOPICS.md # Generated documentation | ||
└── README.md | ||
``` | ||
|
||
## Topics Format | ||
|
||
Each topic is defined in YAML format with the following structure: | ||
|
||
```yaml | ||
title: "Topic Title" # Display name of the topic | ||
slug: "topic-slug" # URL-friendly identifier | ||
categories: # List of categories this topic belongs to | ||
- "Category 1" | ||
- "Category 2" | ||
aliases: # Optional: Alternative names for the topic | ||
- "Alternative Name" | ||
- "Another Name" | ||
excerpt: "A comprehensive description of the topic." | ||
``` | ||
## Usage | ||
### Building the Index | ||
To build the combined index and documentation: | ||
```bash | ||
python scripts/build_index.py | ||
``` | ||
|
||
This will: | ||
|
||
1. Fetch the latest topics from Bitcoin Optech's [/topics.json](https://bitcoinops.org/topics.json). | ||
2. Combine them with additional topics from the `topics/` directory | ||
3. Automatically generate miscellaneous topics for each category to support uncategorized content | ||
4. Generate `topics.json` with the complete topics data | ||
5. Create `TOPICS.md` with categorized listings | ||
|
||
### Adding Topics | ||
|
||
1. Create a new YAML file in the `topics/` directory | ||
2. Follow the topics format described above | ||
3. Run the build script to update the index |
Oops, something went wrong.