menu

Academic

Chat about Source Themes Academic, the page builder for Hugo ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ“๐Ÿš€

Channels
Team

Use the space under Recent post to put twitter feed of my twitter account

May 12, 2020 at 6:33pm

Use the space under Recent post to put twitter feed of my twitter account

May 12, 2020 at 6:33pm

May 12, 2020 at 6:34pm
So where the X is i want to put twitter feed of my tweets
  • reply
  • like
The widget subtitle appears in the area marked by the "X", so you could experiment with using that option with text/Markdown in the widget front matter.
Alternatively, if you paste your HTML Twitter embed code in the body of the Markdown file, the Twitter embed should appear at the end of the widget instance. If the Twitter HTML doesn't render here, then you may need to check your Hugo settings in config.toml allow rendering of HTML.
For more advanced customizations, there's the option to create custom widgets: https://sourcethemes.com/academic/docs/page-builder/#develop-a-new-widget
  • reply
  • like

May 13, 2020 at 4:56pm
I managed to do it
As suggested by , follow the instructions here and instead of starting from scratch, just copy the /themes/academic/layouts/partials/widgets/pages.html widget to your /layouts/partials/widgets folder, renaming it to something else (such as news.html).
like-fill
1
  • reply
  • like
As suggested by , follow the instructions here and instead of starting from scratch, just copy the /themes/academic/layouts/partials/widgets/pages.html widget to your /layouts/partials/widgets folder, renaming it to something else (such as news.html).
Then replace line 75 ({{ with $st.Params.subtitle }}<p>{{ . | markdownify | emojify }}</p>{{ end }}) with the code you get from Twitter Publish
  • reply
  • like
All is left is, in your home directory, locate the posts.md file and tell it to use your new widget
  • reply
  • like

May 25, 2020 at 3:02pm
It only show "Tweets by aavdberg" and further notting.
  • reply
  • like
  • reply
  • like
<div class="row"> <div class="col-12 col-lg-4 section-heading"> <h1>{{ with $st.Title }}{{ . | markdownify | emojify }}{{ end }}</h1> <a class="twitter-timeline" data-width="220" data-height="400" data-dnt="true" data-theme="dark" href="https://twitter.com/aavdberg?ref_src=twsrc%5Etfw">Tweets by aavdberg</a> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> </div> <div class="col-12 col-lg-8">
  • reply
  • like
If I copy your Twitter code:
<a class="twitter-timeline" data-width="220" data-height="400" data-dnt="true" data-theme="dark" href="https://twitter.com/aavdberg?ref\_src=twsrc%5Etfw">Tweets by aavdberg</a> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
I get this. So it's definitely something with your system. Is it updated? I'm using a custom light color theme. Yours is dark so maybe that's interfering with the colors.
  • reply
  • like
Found the problem when you put Microsoft Edge in strict modus it's blocked found this out when i look at F12 console developer mode.
  • reply
  • like
Great! I'm glad you worked it out!
  • reply
  • like
only will now be nice to change the dark and light with the dark and light of the site.
  • reply
  • like
only will now be nice to change the dark and light with the dark and light of the site.
What I have been able to do is to make the background transparent adding data-chrome="transparent"
  • reply
  • like
it's working but not all text is readable anymore, would more niece to find the variable or something to check with if statement to use the right data-theme=$mode
  • reply
  • like
What I have been able to do is to make the background transparent adding data-chrome="transparent"
can't i check with if statement in witch mode it is?
  • reply
  • like

June 12, 2020 at 5:15pm
All is left is, in your home directory, locate the posts.md file and tell it to use your new widget
Hi, could you please tell me how I can tell posts.md to use the new widget for twitter feed? What's the code for that? Can I put it under the contact form?
Edited
  • reply
  • like

June 13, 2020 at 6:03pm
Hi, could you please tell me how I can tell posts.md to use the new widget for twitter feed? What's the code for that? Can I put it under the contact form?
The first line, where it says widget = "pages", change pages to the name of your widget
like-fill
1
  • reply
  • like
like-fill
1
  • reply
  • like

June 28, 2020 at 12:40pm
can't i check with if statement in witch mode it is?
Take a look at this file, lines 44-49:
{{/* Initialise default theme. */}}
{{ if eq ($scr.Get "light") true }}
<script>const isSiteThemeDark = false;</script>
{{ else }}
<script>const isSiteThemeDark = true;</script>
{{ end }}
with {{ $scr := $.Scratch }}.
  • reply
  • like