How do I get a URL variable in a template? I am trying to include a certain .html file if the URL has ?work=1.

So far I have this, which I got from 
Check URL for string in a Twig file.

 {% if 'work' in url %}
    {{ include('work/index.html') }}
 {% endif %}


They say I need a function in my .theme file to actually get the URL variable.
Is that right? Is there any way to get it with just Twig?
Ok nevermind. On the other stack I mentioned the function was

function riptide7_preprocess_page_title(&amp;$variables) {
  $variables['url'] = $_SERVER['REQUEST_URI'];
  $variables['#cache']['contexts'][] = 'url.path';
    echo "What?!";
}


and I just had to change preprocess_page_title to preprocess_page