Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
.discourse-site
HELP
.idea
discourse
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# Plugin-Outlets
# Discourse Plugin-Outlets Theme Component

Generated by moving the output of the script below into common/head_tag.html
1. Invoke the update script to regenerate the required files
```
#!/bin/bash
grep -r plugin-outlet /var/www/discourse/app/|grep name|grep -o -e 'name=".*'|awk -F\" '{print $2}'|sort|uniq | while read p ; do
echo "<script type=\"text/x-handlebars\" data-template-name=\"/connectors/$p/plugin-outlet-component\">"
echo "<div class=\"outlet\">$p</div>"
echo "</script>"
done
./update.sh
```

2. Push updates into your own fork
3. Install your repository into Discourse via the Admin Panal as a Theme Component

28 changes: 28 additions & 0 deletions update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

# Fail fast
set -e

# Clone or update discourse against current master
echo "Updating discourse..."
if [ -d "discourse" ]; then
cd discourse
git fetch --depth 1
git reset --hard origin/master
git clean -dfx
cd ..
else
git clone --depth 1 https://github.com/discourse/discourse
fi

# Build new file with all outlets
echo "Building new outlets file..."
echo -n "" > common/head_tag.html
grep -r plugin-outlet discourse|grep name|grep -o -e 'name=".*'|awk -F\" '{print $2}'|sort|uniq | while read p ; do
echo "<script type=\"text/x-handlebars\" data-template-name=\"/connectors/$p/plugin-outlet-component\">" >> common/head_tag.html
echo "<div class=\"outlet\">$p</div>" >> common/head_tag.html
echo "</script>" >> common/head_tag.html
done

# We are done
echo "Done"