Skip to content

Commit

Permalink
Remove Twitter widget
Browse files Browse the repository at this point in the history
  • Loading branch information
thpani committed Oct 17, 2023
1 parent f86f96f commit 526b666
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 58 deletions.
18 changes: 0 additions & 18 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,31 +37,13 @@ <h1><a href="{{ "/" | absolute_url }}">{{ site.title | default: site.github.repo
<li><a href="{{ site.github.repository_url }}">View On <strong>GitHub</strong></a></li>
</ul>
{% endif %}

<!-- Tall Twitter widget for wide screens. See `style.scss` for details. -->
<a class="twitter-timeline" id="twitter-timeline-0" href="https://twitter.com/ApalacheTLA?ref_src=twsrc%5Etfw">Tweets by ApalacheTLA</a>
</header>
<section>

{{ content }}

</section>

<!-- Short Twitter widget for narrow screens. See `style.scss` for details. -->
<a class="twitter-timeline" id="twitter-timeline-1" data-height="400" href="https://twitter.com/ApalacheTLA?ref_src=twsrc%5Etfw">Tweets by ApalacheTLA</a>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

</div>
<script src="{{ "/assets/js/scale.fix.js" | relative_url }}"></script>
{% if site.google_analytics %}
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', '{{ site.google_analytics }}', 'auto');
ga('send', 'pageview');
</script>
{% endif %}
</body>
</html>
40 changes: 0 additions & 40 deletions assets/css/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,43 +4,3 @@
@import "{{ site.theme }}";

// Custom styles go here

/*
* Show a smaller Twitter widget on narrow screens.
*
* We use two widgets, #twitter-widget-0 (unbounded height for wide screens),
* and #twitter-widget-1 (bounded height for narrow screens).
*
* This CSS hack is necessary because the widget location is marked in HTML
* using an <a> element. An iframe of correct bounding height is injected at
* its location via Twitter's JS. The iframe height is pre-set via
* `data-height` attribute on the corresponding <a>.
*
* Custom resizing of the widget iframe via CSS is not an option, because
* - Twitter's injected JS resets the iframe height on resize events, and
* - contained HTML is rendered wrt/ to iframe height to keep user controls
* within the viewport.
*
* We use !important to override the element-level `display` property set by
* Twitter's JS.
*/

// Default: hide the short twitter widget and its injection <a>.
#twitter-timeline-1,
#twitter-widget-1 {
display: none !important;
}

// On narrow screens: Show short twitter widget, hide tall one.
@media print, screen and (max-width: 960px) {
#twitter-timeline-1 {
display: inline !important;
}
#twitter-widget-1 {
display: inline-block !important;
}
#twitter-timeline-0,
#twitter-widget-0 {
display: none !important;
}
}

0 comments on commit 526b666

Please sign in to comment.