Hello,
I have a homepage hosted on github pages… I would like to link to my writeas blog on it (done) but on my blog where one would pin an about, is there a way to put a link to a page out side of writeas?
Thanks
Hello,
I have a homepage hosted on github pages… I would like to link to my writeas blog on it (done) but on my blog where one would pin an about, is there a way to put a link to a page out side of writeas?
Thanks
Hi @TimApple,
You can accomplish this by adding the following code to your ‘Custom Javascript’:
var a = document.querySelector('a[href="https://write.as/cjeller/post-to-replace"]');
if (a) {
a.setAttribute('href', 'https://replacing-post.site');
}
This is what I use for my blog (here). Hope it helps!
So I have to have the pinned post there? Then this just does a switchero?
Why your sharing, also how did you get the cool little notes on the side of your posts?
Thanks
You’re welcome! And yes, as long as declared variable matches the pinned post’s url then the code does the switchero. Let me know if it works for you!
As far as the little side notes go, it is all CSS taken from a cool CSS resource called Tufte CSS (here). I took how it does side notes and added it the following to the ‘Custom CSS’:
.marginnote { float: right;
clear: right;
margin-right: -60%;
width: 50%;
margin-top: 0;
margin-bottom: 0;
font-size: 0.8rem;
line-height: 1.3;
vertical-align: baseline;
position: relative; }
.marginnote:before { font-family: et-book-roman-old-style;
position: relative;
vertical-align: baseline; }
blockquote .marginnote { margin-right: -82%;
min-width: 59%;
text-align: left; }
Then, in your post, wrap the notes in <span class="marginnote"> An example</>
and you’re off to the races! Just needs a experimentation a little in order to align the notes correctly. Hopefully it’ll work until Extended Markdown is implemented in the future.
Thanks!
It doesn’t seem to be working for me… will continue to troubleshoot
@cjeller1592’s workaround is indeed a good way to do it for now. But we do plan to support this. Development is being tracked here: https://writefreely.org/tasks/599
Any luck in troubleshooting?
One problem I ran into was making sure the root blog url for the pinned post (the https://write.as/cjeller/ in https://write.as/cjeller/post) was the same as the set preferred url for the blog (the one people access the blog from).
Since I use a custom domain, if I tried to access the pinned post from the blog’s write.as url, the Javascript would not work. Hope that helps and let us know if there’s anything else that could be looked at to remedy the situation.
Just wanted to say big thanks @cjeller1592 for this also! Been wondering how to do this for a while, lol.
I have found however that as you pointed out, if you changed the reading format of your posts from the default “write.as/user/post
” to “user.writeas.com/post
”, you should use the format your readers see, and it will only work when viewing the site as a reader.